From: xiubli@redhat.com
To: jlayton@kernel.org, idryomov@gmail.com, dhowells@redhat.com
Cc: vshankar@redhat.com, linux-kernel@vger.kernel.org,
ceph-devel@vger.kernel.org, willy@infradead.org,
keescook@chromium.org, linux-fsdevel@vger.kernel.org,
linux-cachefs@redhat.com, Xiubo Li <xiubli@redhat.com>
Subject: [PATCH 2/2] ceph: do not release the folio lock in kceph
Date: Fri, 1 Jul 2022 10:29:47 +0800 [thread overview]
Message-ID: <20220701022947.10716-3-xiubli@redhat.com> (raw)
In-Reply-To: <20220701022947.10716-1-xiubli@redhat.com>
From: Xiubo Li <xiubli@redhat.com>
The netfs layer should be responsible to unlock and put the folio,
and we will always return 0 when succeeds.
URL: https://tracker.ceph.com/issues/56423
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
fs/ceph/addr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index fe6147f20dee..3ef5200e2005 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1310,16 +1310,16 @@ static int ceph_netfs_check_write_begin(struct file *file, loff_t pos, unsigned
if (snapc) {
int r;
- folio_unlock(folio);
- folio_put(folio);
if (IS_ERR(snapc))
return PTR_ERR(snapc);
+ folio_unlock(folio);
ceph_queue_writeback(inode);
r = wait_event_killable(ci->i_cap_wq,
context_is_writeable_or_written(inode, snapc));
ceph_put_snap_context(snapc);
- return r == 0 ? -EAGAIN : r;
+ folio_lock(folio);
+ return r == 0 ? -EAGAIN : 0;
}
return 0;
}
--
2.36.0.rc1
prev parent reply other threads:[~2022-07-01 2:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 2:29 [PATCH 0/2] netfs, ceph: fix the crash when unlocking the folio xiubli
2022-07-01 2:29 ` [PATCH 1/2] netfs: release the folio lock and put the folio before retrying xiubli
2022-07-01 10:38 ` Jeff Layton
2022-07-04 1:13 ` Xiubo Li
2022-07-04 2:10 ` Matthew Wilcox
2022-07-04 2:40 ` Xiubo Li
2022-07-04 6:58 ` Xiubo Li
2022-07-05 13:21 ` David Howells
2022-07-05 13:41 ` Jeff Layton
2022-07-06 0:58 ` Xiubo Li
2022-07-01 2:29 ` xiubli [this message]
Reply instructions:
You may reply publicly 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=20220701022947.10716-3-xiubli@redhat.com \
--to=xiubli@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vshankar@redhat.com \
--cc=willy@infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).