Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1127765ybe; Wed, 11 Sep 2019 09:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPpUFjw4EIE6zNdf0ywzIY5nsmc2Q8EKSQkeoeMUuNeh88yFLmbYTRp0biG1RYlvJ2QQmw X-Received: by 2002:a17:906:7fd9:: with SMTP id r25mr7967000ejs.22.1568220465393; Wed, 11 Sep 2019 09:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568220465; cv=none; d=google.com; s=arc-20160816; b=zvFneb1B3cmBxwpsU9S4dFBEKo02VYzZM9i9/OAGnStY3tKfLFGzo0zjw38MPgVJhl fxE4cJt6aXWKF732AcRodCVWx0tlqzIYKLFOEwX2vJ3B+ZoAUmLu1y/bxHapcBvmEGv5 U3gSFkqy56esZ/CJMB7IRUQWXU+jnqTeztSLjBd+x5iV2LYh3JLuRKprW7zZz5WGaaaD zzg94V0Q/XSlt8FqFysTDcm4klrev942ZNbBvCml2oZGtfaPUI9J/m0ojilKy3cCkZQ3 +7/90CscQSIkLAuQFaVH30QrvHIy2XYqjBeXIOqh/PvbdxgmU/1okLSjrbg+EF06nw6k XZvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=+HB7ZrcvuDEZw1Pzj0w8UVsUM1xr3H/8VRtU+tYNbrs=; b=AdzVTJUdGZ0xFqLFJ0p3ZS0wYE9/QX7TVriiHZXEe4ZR6s53plIx4DWJadIyU07AYG LtoEo0AkYuVKSMqWTD2kJAPtvgByAPvX9R5T1ct77T2rHDIS/zooeOLRWHxDgXxkR2DK X7PFgvOoT7xIQkrVgeyHGX2MeRWAyYKDh1EDlGMs4MTOAkUYoI1232QKKJ3xt8jTrJyL o1bG0/S7Q/i/YxqdpWHZC8kiyPMGZz2ZhSl4lgExHlhzb3Pvz643fH1mH6zaQmxSp5+p sUqvlcYR6+LpZVZ2kLdanska1x7l23gTMCLmOYVT5APLxi2pxkOQbuwoj9TlJbkC3+AT B07A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si11104180eje.185.2019.09.11.09.47.21; Wed, 11 Sep 2019 09:47:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729226AbfIKQp2 (ORCPT + 99 others); Wed, 11 Sep 2019 12:45:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:34410 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728896AbfIKQp1 (ORCPT ); Wed, 11 Sep 2019 12:45:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EFFBFAF84; Wed, 11 Sep 2019 16:45:25 +0000 (UTC) From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, hch@infradead.org, andres@anarazel.de, david@fromorbit.com, riteshh@linux.ibm.com, linux-f2fs-devel@lists.sourceforge.net, Goldwyn Rodrigues Subject: [PATCH 1/3] btrfs: fix inode rwsem regression Date: Wed, 11 Sep 2019 11:45:15 -0500 Message-Id: <20190911164517.16130-2-rgoldwyn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190911164517.16130-1-rgoldwyn@suse.de> References: <20190911093926.pfkkx25mffzeuo32@alap3.anarazel.de> <20190911164517.16130-1-rgoldwyn@suse.de> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Goldwyn Rodrigues This is similar to 942491c9e6d6 ("xfs: fix AIM7 regression") Apparently our current rwsem code doesn't like doing the trylock, then lock for real scheme. So change our read/write methods to just do the trylock for the RWF_NOWAIT case. Fixes: edf064e7c6fe ("btrfs: nowait aio support") Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 58a18ed11546..651b2b1f4219 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1893,9 +1893,10 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb, (iocb->ki_flags & IOCB_NOWAIT)) return -EOPNOTSUPP; - if (!inode_trylock(inode)) { - if (iocb->ki_flags & IOCB_NOWAIT) + if (iocb->ki_flags & IOCB_NOWAIT) { + if (!inode_trylock(inode)) return -EAGAIN; + } else { inode_lock(inode); } -- 2.16.4