All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zyan@redhat.com>
To: ceph-devel@vger.kernel.org
Cc: jlayton@kernel.org, "Yan, Zheng" <zyan@redhat.com>
Subject: [PATCH v4 6/6] ceph: check all mds' caps after page writeback
Date: Thu,  5 Mar 2020 01:32:58 +0800	[thread overview]
Message-ID: <20200304173258.48377-7-zyan@redhat.com> (raw)
In-Reply-To: <20200304173258.48377-1-zyan@redhat.com>

If an inode has caps from multiple mds's, the following can happen:

- non-auth mds revokes Fsc. Fcb is used, so page writeback is queued.
- when writeback finishes, ceph_check_caps() is called with auth only
  flag. ceph_check_caps() invalidates pagecache, but skips checking any
  non-auth caps.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/caps.c  | 2 +-
 fs/ceph/inode.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 0408749ced2d..5e9aecfa2f52 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3052,7 +3052,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
 	spin_unlock(&ci->i_ceph_lock);
 
 	if (last) {
-		ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
+		ceph_check_caps(ci, 0, NULL);
 	} else if (flush_snaps) {
 		ceph_flush_snaps(ci, NULL);
 	}
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index c7ff9f7067f6..ee40ba7e0e77 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1984,7 +1984,7 @@ void __ceph_do_pending_vmtruncate(struct inode *inode)
 	mutex_unlock(&ci->i_truncate_mutex);
 
 	if (wrbuffer_refs == 0)
-		ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
+		ceph_check_caps(ci, 0, NULL);
 
 	wake_up_all(&ci->i_cap_wq);
 }
-- 
2.21.1

  parent reply	other threads:[~2020-03-04 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 17:32 [PATCH v4 0/6] ceph: don't request caps for idle open files Yan, Zheng
2020-03-04 17:32 ` [PATCH v4 1/6] ceph: always renew caps if mds_wanted is insufficient Yan, Zheng
2020-03-04 17:32 ` [PATCH v4 2/6] ceph: consider inode's last read/write when calculating wanted caps Yan, Zheng
2020-03-04 17:32 ` [PATCH v4 3/6] ceph: remove delay check logic from ceph_check_caps() Yan, Zheng
2020-03-04 17:32 ` [PATCH v4 4/6] ceph: simplify calling of ceph_get_fmode() Yan, Zheng
2020-03-04 17:32 ` [PATCH v4 5/6] ceph: update i_requested_max_size only when sending cap msg to auth mds Yan, Zheng
2020-03-04 17:32 ` Yan, Zheng [this message]
2020-03-04 17:48 ` [PATCH v4 0/6] ceph: don't request caps for idle open files Jeff Layton
2020-03-04 19:24   ` Jeff Layton
2020-03-04 20:23     ` Jeff Layton
2020-03-05 12:23   ` Yan, Zheng

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=20200304173258.48377-7-zyan@redhat.com \
    --to=zyan@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.