diff options
author | Yan, Zheng <zyan@redhat.com> | 2020-03-05 15:21:02 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-03-30 13:42:42 +0300 |
commit | 135e671e54fcb46cb4f8b7be9673d3ea7b8ac315 (patch) | |
tree | 1969664881be83f3caf31db3f5d4aedb7507f669 /fs/ceph/inode.c | |
parent | a0d93e327fc424b94e78a1b25287bb4e632ee054 (diff) | |
download | linux-135e671e54fcb46cb4f8b7be9673d3ea7b8ac315.tar.xz |
ceph: simplify calling of ceph_get_fmode()
Originally, calling ceph_get_fmode() for open files is by thread that
handles request reply. There is a small window between updating caps and
and waking the request initiator. We need to prevent ceph_check_caps()
from releasing wanted caps in the window.
Previous patches made fill_inode() call __ceph_touch_fmode() for open file
requests. This prevented ceph_check_caps() from releasing wanted caps for
'caps_wanted_delay_min' seconds, enough for request initiator to get
woken up and call ceph_get_fmode().
This allows us to now call ceph_get_fmode() in ceph_open() instead.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index c4dd534aaec3..c7ff9f7067f6 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -970,7 +970,7 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page, if (ceph_snap(inode) == CEPH_NOSNAP) { ceph_add_cap(inode, session, le64_to_cpu(info->cap.cap_id), - cap_fmode, info_caps, + info_caps, le32_to_cpu(info->cap.wanted), le32_to_cpu(info->cap.seq), le32_to_cpu(info->cap.mseq), @@ -995,13 +995,7 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page, dout(" %p got snap_caps %s\n", inode, ceph_cap_string(info_caps)); ci->i_snap_caps |= info_caps; - if (cap_fmode >= 0) - __ceph_get_fmode(ci, cap_fmode); } - } else if (cap_fmode >= 0) { - pr_warn("mds issued no caps on %llx.%llx\n", - ceph_vinop(inode)); - __ceph_get_fmode(ci, cap_fmode); } if (iinfo->inline_version > 0 && |