ceph: properly drop caps for setattr request
For CEPH_SETATTR_ATIME, MDS needs to xlock filelock, Fsxrw caps are not allowed for xlocked filelock. For CEPH_SETATTR_SIZE request that truncates file to smaller size, MDS needs to xlock filelock, Fsxrw caps are not allowed for xlocked filelock. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
d19a0b5401
commit
be70489eff
@ -2000,8 +2000,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
|
||||
ceph_encode_timespec(&req->r_args.setattr.atime,
|
||||
&attr->ia_atime);
|
||||
mask |= CEPH_SETATTR_ATIME;
|
||||
release |= CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_RD |
|
||||
CEPH_CAP_FILE_WR;
|
||||
release |= CEPH_CAP_FILE_SHARED |
|
||||
CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR;
|
||||
}
|
||||
}
|
||||
if (ia_valid & ATTR_MTIME) {
|
||||
@ -2022,8 +2022,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
|
||||
ceph_encode_timespec(&req->r_args.setattr.mtime,
|
||||
&attr->ia_mtime);
|
||||
mask |= CEPH_SETATTR_MTIME;
|
||||
release |= CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_RD |
|
||||
CEPH_CAP_FILE_WR;
|
||||
release |= CEPH_CAP_FILE_SHARED |
|
||||
CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR;
|
||||
}
|
||||
}
|
||||
if (ia_valid & ATTR_SIZE) {
|
||||
@ -2041,8 +2041,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
|
||||
req->r_args.setattr.old_size =
|
||||
cpu_to_le64(inode->i_size);
|
||||
mask |= CEPH_SETATTR_SIZE;
|
||||
release |= CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_RD |
|
||||
CEPH_CAP_FILE_WR;
|
||||
release |= CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL |
|
||||
CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user