summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-10-08 11:06:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-10-08 11:06:08 -0400
commite55f1d1d13e7f1c364672d667d78fd1f640ab9f9 (patch)
tree406a3c127abb008f2f736c8d2ee03fc3c2926d6b /fs/ceph/inode.c
parentf334bcd94b7d3c0fbc34d518a86548f451ab5faf (diff)
parent030b533c4fd4d2ec3402363323de4bb2983c9cee (diff)
downloadop-kernel-dev-e55f1d1d13e7f1c364672d667d78fd1f640ab9f9.zip
op-kernel-dev-e55f1d1d13e7f1c364672d667d78fd1f640ab9f9.tar.gz
Merge remote-tracking branch 'jk/vfs' into work.misc
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index dd3a6db..082e82d 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1905,13 +1905,6 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
int inode_dirty_flags = 0;
bool lock_snap_rwsem = false;
- if (ceph_snap(inode) != CEPH_NOSNAP)
- return -EROFS;
-
- err = inode_change_ok(inode, attr);
- if (err != 0)
- return err;
-
prealloc_cf = ceph_alloc_cap_flush();
if (!prealloc_cf)
return -ENOMEM;
@@ -2124,7 +2117,17 @@ out_put:
*/
int ceph_setattr(struct dentry *dentry, struct iattr *attr)
{
- return __ceph_setattr(d_inode(dentry), attr);
+ struct inode *inode = d_inode(dentry);
+ int err;
+
+ if (ceph_snap(inode) != CEPH_NOSNAP)
+ return -EROFS;
+
+ err = setattr_prepare(dentry, attr);
+ if (err != 0)
+ return err;
+
+ return __ceph_setattr(inode, attr);
}
/*
OpenPOWER on IntegriCloud