Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1763639pxp; Mon, 7 Mar 2022 01:44:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJweX8GgqPbLpKJle5ULl38xrH5IaxRft1sYc2a0xJO/g+KIQerBqF3rqJrrgZ+eMReQ1GIK X-Received: by 2002:aa7:cfd6:0:b0:415:d33a:5d21 with SMTP id r22-20020aa7cfd6000000b00415d33a5d21mr10313890edy.325.1646646256771; Mon, 07 Mar 2022 01:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646646256; cv=none; d=google.com; s=arc-20160816; b=D01xsmCTyTW+BBB8zuytImdeT91pv6pUduqcDt9SsiYT0njxEiwsc0SezNNdC7Vhl5 H1Dv8IECAv0sBaowDpsCsZoDAoWf6qdBGfKAxtiVQaaA5RDO2QvdAeuJwQ/+9macwqYG kIYhXyfOwTQdmUH5DF1aBQLskNymB2HBd62tyUBqpKOu7H6s4JmfpGbGa7XFXWkHH/Xg 49A5ojr3mCB8ESAqBT0L9K3QFxLbGNDz/JSi6RLy7IyKQGoxYJwyqgmcQZyEctsFmBpi wWJmAjR75UXte41tSEzzK0h9515gceX2yHuUgEeMxuVM5ItlOPSTBYIPvgB/nV/iCPQ3 JVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xo58dTEXY/F27fYmOPR69bFboaa6IH78uUyf90/I3RI=; b=Vd1y+ftTzShmMGsPzGmw/RnAA5tN4Orw3TlRjCtNbAtF8MelZ2k5gyTaqqZ5AKSSm7 GwSpUKZfAYb+/AJvEMxH62w4YZAz0R+v3iaMDsR9DL0OMZxfrvNd3/AXLhSaVWL/auOA Ql6SuQZitgPXV4HZ8hD326HjuvdInjKYA5cuHSD0x3VSh29KDBXw21XI5I6azDmvu+JC PgzbgFEY2c610exauYt2IPVaNSD0OfPlCcjQDdVGIcbwhQf0bCMJF2jUok7Kx3v8p71G H/vD5YqJoQYF0a1qAj/59hWr4bjxz2UiD+enAHiNZdmN5H8TTuzWyOPzthoMfz3Mbi+5 tPMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ouJ9RdXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a1709062ec400b006ab8590c1e1si6975808eji.33.2022.03.07.01.43.53; Mon, 07 Mar 2022 01:44:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ouJ9RdXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234131AbiCGH4x (ORCPT + 99 others); Mon, 7 Mar 2022 02:56:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232814AbiCGH4v (ORCPT ); Mon, 7 Mar 2022 02:56:51 -0500 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E664476E for ; Sun, 6 Mar 2022 23:55:57 -0800 (PST) Received: by mail-il1-x134.google.com with SMTP id h2so614909ila.12 for ; Sun, 06 Mar 2022 23:55:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xo58dTEXY/F27fYmOPR69bFboaa6IH78uUyf90/I3RI=; b=ouJ9RdXFMnX5gGHLKbsx9hsTgcffnj3wGWeNg4qpAqsc97iAu8JCrIunoXNmm1vqIi Pcq8dvQIYDuAbl+956vKOKPiO8YtE/7zS4bGkXjil5DclKrGUwMv88jrCN562G6miir9 wL759rF4Dumw6tsge2gPyhKrQwPMfQOSg2CtK+oNuH8odEq7z/7UMfbc6FuboeH+/h3c 6mBauXZMFi+HU8TkLdDRnu797IqogPdUqxC7MgM3B+YiVqQ43mdzb95dMOjbtGIDHId1 3bre+uwFJ7ampbhJ+GMbnQBRBACVRxL1bw03GwyodfxOK0QZ6RMdGIum/qp710NMUN9r mO7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xo58dTEXY/F27fYmOPR69bFboaa6IH78uUyf90/I3RI=; b=ci9iPkywlLrlUUKTauO+zFrWOaZ2zELs+tVneK6vi4CPbSVRK+Jhl1Am2YZ2p/0qwW 5zSogBw2YMVAXt9Dj1CekdCa12Mt0WLMgs6OEW5sCE++H3EbdNUg1o+5Jdq7wu1mt7/n pPY9d+a3NzGuS7lK0tNc5FKPA2a3QXiWkkQP7aQDJ5hdTgkFyZH4DQcabxvwonxsa7yZ CmQuxIgz2ivglKf8sF5W1QRiD6wTwZ2KxNv4KUonTBeob+ePpkAXkBi0d02P7PBfnm2H YdctdN5AOqczX7P15miG+8rVhSv78eCGmfbQDQgsYOinaHmKbPX2wng0Gbu/gUM5BtEm tn7Q== X-Gm-Message-State: AOAM532OO1gITh7CmliJPHA5YnvDbsGgZg/5dZP0yGLjxj6cNyr78bt6 fG7hwdih1eTgrVISvvBNBbMGxLNlC14mxxTyY68eyw== X-Received: by 2002:a92:6907:0:b0:2bc:4b18:e671 with SMTP id e7-20020a926907000000b002bc4b18e671mr9712117ilc.299.1646639757324; Sun, 06 Mar 2022 23:55:57 -0800 (PST) MIME-Version: 1.0 References: <20211229040239.66075-1-zhangjiachen.jaycee@bytedance.com> In-Reply-To: From: Jiachen Zhang Date: Mon, 7 Mar 2022 15:55:46 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v2] fuse: fix deadlock between atomic O_TRUNC open() and page invalidations To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Xie Yongji Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 4, 2022 at 11:30 PM Miklos Szeredi wrote: > > On Fri, 4 Mar 2022 at 07:23, Jiachen Zhang > wrote: > > > I tested this fix, and it did pass the xfstests generic/464 in our > > Thanks for testing! > > > environment. However, if I understand correctly, one of the usages of > > the nowrite is to protect file truncation, as said in the commit > > message of e4648309b85a78f8c787457832269a8712a8673e. So, does that > > mean this fix may introduce some other problems? > > That's an excellent question. I don't think this will cause an issue, > since the nowrite protection is for truncation of the file on the > server (userspace) side. The inode lock still protects concurrent > writes against page cache truncation in the writeback cache case. In > the non-writeback cache case the nowrite protection does not do > anything. Got it. So the nowrite is protecting O_TRUNC FUSE_OPEN (or truncating FUSE_SETATTR) against FUSE_WRITE in writeback_cache mode? Then this patch looks good to me. Thanks, Jiachen > > Thanks, > Miklos