From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C73EC433EF for ; Mon, 7 Mar 2022 07:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236000AbiCGH4z (ORCPT ); Mon, 7 Mar 2022 02:56:55 -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-Google-Smtp-Source: ABdhPJwS/bLUDjG66OuG9kDu3XVfgunh5kbfyN6i+8T3f3mMdXidurrKrq/cKnLH3uPLi90tx8VbI8LSCnG2kSGKvPM= 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" 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