]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ceph: update i_requested_max_size only when sending cap msg to auth mds
authorYan, Zheng <zyan@redhat.com>
Thu, 5 Mar 2020 12:21:03 +0000 (20:21 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 30 Mar 2020 10:42:42 +0000 (12:42 +0200)
Non-auth mds can't do anything to 'update max' cap message.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 02dd2a9bd2522cd0bc8b23c4a216262e89c48859..0b3a36310033297b567616396e08daa6a359cc45 100644 (file)
@@ -1371,7 +1371,8 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        arg.size = inode->i_size;
        ci->i_reported_size = arg.size;
        arg.max_size = ci->i_wanted_max_size;
-       ci->i_requested_max_size = arg.max_size;
+       if (cap == ci->i_auth_cap)
+               ci->i_requested_max_size = arg.max_size;
 
        if (flushing & CEPH_CAP_XATTR_EXCL) {
                old_blob = __ceph_build_xattrs_blob(ci);