From: John Spray Date: Tue, 15 Dec 2015 13:20:03 +0000 (+0000) Subject: mds: fix setvxattr (broken in a536d114) X-Git-Tag: v10.0.2~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6941%2Fhead;p=ceph.git mds: fix setvxattr (broken in a536d114) There was an accidental move of this line when adding the MAY_SET_POOL check, which was causing setxattr to proceed before it had the right locks, and thereby apply its checks on bad data (symptom was failing to detect that the file had data written to it). Fixes: #14029 Signed-off-by: John Spray --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 5b7222e4dcd7..3887faac5067 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -4157,6 +4157,7 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur, return; } + xlocks.insert(&cur->filelock); if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks)) return; @@ -4166,7 +4167,6 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur, } } - xlocks.insert(&cur->filelock); pi = cur->project_inode(); int64_t old_pool = pi->layout.fl_pg_pool; pi->add_old_pool(old_pool);