Message ID | 20200302141434.59825-8-jlayton@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ceph: async directory operations support | expand |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 51483ba572b3..c60b28304c50 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2616,7 +2616,10 @@ static int try_get_cap_refs(struct inode *inode, int need, int want, } snap_rwsem_locked = true; } - *got = need | (have & want); + if ((have & want) == want) + *got = need | want; + else + *got = need; if (S_ISREG(inode->i_mode) && (need & CEPH_CAP_FILE_RD) && !(*got & CEPH_CAP_FILE_CACHE))