if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
return;
+ if (!check_access(mdr, cur, MAY_WRITE))
+ return;
+
// project update
inode_t *pi = cur->project_inode();
pi->layout = layout;
if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
return;
+ if (!check_access(mdr, cur, MAY_WRITE))
+ return;
+
// validate layout
const inode_t *old_pi = cur->get_projected_inode();
ceph_file_layout layout;
if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
return;
+ if (!check_access(mdr, cur, MAY_WRITE))
+ return;
+
map<string, bufferptr> *pxattrs = cur->get_projected_xattrs();
if ((flags & CEPH_XATTR_CREATE) && pxattrs->count(name)) {
dout(10) << "setxattr '" << name << "' XATTR_CREATE and EEXIST on " << *cur << dendl;