Linux-f2fs-devel Archive on lore.kernel.org
 help / color / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: david@fromorbit.com, linux-f2fs-devel@lists.sourceforge.net,
	hch@infradead.org, Goldwyn Rodrigues <rgoldwyn@suse.com>,
	linux-ext4@vger.kernel.org, andres@anarazel.de,
	linux-btrfs@vger.kernel.org
Subject: [f2fs-dev] [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> (raw)
In-Reply-To: <20190911164517.16130-1-rgoldwyn@suse.de>

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

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 <rgoldwyn@suse.com>
---
 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



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190911093926.pfkkx25mffzeuo32@alap3.anarazel.de>
2019-09-11 16:45 ` [f2fs-dev] Fix inode sem regression for nowait Goldwyn Rodrigues
2019-09-11 16:45   ` Goldwyn Rodrigues [this message]
2019-09-11 17:21     ` [f2fs-dev] [PATCH 1/3] btrfs: fix inode rwsem regression David Sterba
2019-09-11 16:45   ` [f2fs-dev] [PATCH 2/3] ext4: " Goldwyn Rodrigues
2019-09-12  8:52     ` Ritesh Harjani
2019-09-12  9:26       ` Matthew Bobrowski
2019-09-11 16:45   ` [f2fs-dev] [PATCH 3/3] f2fs: " Goldwyn Rodrigues
2019-09-12  6:17     ` Chao Yu
2019-09-13 19:46     ` Jaegeuk Kim
2019-09-16  1:16       ` Chao Yu

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190911164517.16130-2-rgoldwyn@suse.de \
    --to=rgoldwyn@suse.de \
    --cc=andres@anarazel.de \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-f2fs-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-f2fs-devel/0 linux-f2fs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ https://lore.kernel.org/linux-f2fs-devel \
		linux-f2fs-devel@lists.sourceforge.net linux-f2fs-devel@archiver.kernel.org
	public-inbox-index linux-f2fs-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/net.sourceforge.lists.linux-f2fs-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox