diff options
author | Yan, Zheng <zyan@redhat.com> | 2018-05-24 23:22:56 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-06-04 14:46:01 -0400 |
commit | fa466743a9fc6e4a24ef22285fb384f9ef4a2edb (patch) | |
tree | db36039f312716eee7329c4acde9201dd7240bf0 /fs/ceph/caps.c | |
parent | a86f009f106cba322c608785e09c8b5be8ffe8bb (diff) |
ceph: fix wrong check for the case of updating link count
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 477b822e6333..0ae41854d676 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -3059,7 +3059,6 @@ static void handle_cap_grant(struct inode *inode, | |||
3059 | int used, wanted, dirty; | 3059 | int used, wanted, dirty; |
3060 | u64 size = le64_to_cpu(grant->size); | 3060 | u64 size = le64_to_cpu(grant->size); |
3061 | u64 max_size = le64_to_cpu(grant->max_size); | 3061 | u64 max_size = le64_to_cpu(grant->max_size); |
3062 | struct timespec mtime, atime, ctime; | ||
3063 | int check_caps = 0; | 3062 | int check_caps = 0; |
3064 | bool wake = false; | 3063 | bool wake = false; |
3065 | bool writeback = false; | 3064 | bool writeback = false; |
@@ -3124,7 +3123,7 @@ static void handle_cap_grant(struct inode *inode, | |||
3124 | from_kgid(&init_user_ns, inode->i_gid)); | 3123 | from_kgid(&init_user_ns, inode->i_gid)); |
3125 | } | 3124 | } |
3126 | 3125 | ||
3127 | if ((newcaps & CEPH_CAP_AUTH_SHARED) && | 3126 | if ((newcaps & CEPH_CAP_LINK_SHARED) && |
3128 | (extra_info->issued & CEPH_CAP_LINK_EXCL) == 0) { | 3127 | (extra_info->issued & CEPH_CAP_LINK_EXCL) == 0) { |
3129 | set_nlink(inode, le32_to_cpu(grant->nlink)); | 3128 | set_nlink(inode, le32_to_cpu(grant->nlink)); |
3130 | if (inode->i_nlink == 0 && | 3129 | if (inode->i_nlink == 0 && |
@@ -3149,6 +3148,7 @@ static void handle_cap_grant(struct inode *inode, | |||
3149 | } | 3148 | } |
3150 | 3149 | ||
3151 | if (newcaps & CEPH_CAP_ANY_RD) { | 3150 | if (newcaps & CEPH_CAP_ANY_RD) { |
3151 | struct timespec mtime, atime, ctime; | ||
3152 | /* ctime/mtime/atime? */ | 3152 | /* ctime/mtime/atime? */ |
3153 | ceph_decode_timespec(&mtime, &grant->mtime); | 3153 | ceph_decode_timespec(&mtime, &grant->mtime); |
3154 | ceph_decode_timespec(&atime, &grant->atime); | 3154 | ceph_decode_timespec(&atime, &grant->atime); |