From d46583011527cc927c6e1f5dc393114b140b4384 Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 15 Dec 2015 13:20:03 +0000 Subject: [PATCH] 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 --- src/mds/Server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 5b7222e4dcd..3887faac506 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); -- 2.47.3