fix few root xattr bugs
cover fix few root xattr bugs
The first patch fixes a bug that causes MDS crash while setting or removing xattrs on root directory.
The second patch fixes another bug that root xattrs not correctly logged in MDS journal.
Kuan Kai Chiu (2):
mds: fix setting/removing xattrs on root
mds: journal the projected root xattrs in add_root()
src/mds/Server.cc | 6 ++---- src/mds/events/EMetaBlob.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/2 mds: fix setting/removing xattrs on root
MDS crashes while journaling dirty root inode in handle_client_setxattr and handle_client_removexattr. We should use journal_dirty_inode to safely log root inode here.
--- src/mds/Server.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
src/mds/Server.cc +2 -4
@@ -3907,8 +3907,7 @@ void Server::handle_client_setxattr(MDRequest *mdr) mdlog->start_entry(le); le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid()); mdcache->predirty_journal_parents(mdr, &le->metablob, cur, 0, PREDIRTY_PRIMARY, false); - mdcache->journal_cow_inode(mdr, &le->metablob, cur); - le->metablob.add_primary_dentry(cur->get_projected_parent_dn(), true, cur); + mdcache->journal_dirty_inode(mdr, &le->metablob, cur); journal_and_reply(mdr, cur, 0, le, new C_MDS_inode_update_finish(mds, mdr, cur)); }
@@ -3964,8 +3963,7 @@ void Server::handle_client_removexattr(MDRequest *mdr) mdlog->start_entry(le); le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid()); mdcache->predirty_journal_parents(mdr, &le->metablob, cur, 0, PREDIRTY_PRIMARY, false); - mdcache->journal_cow_inode(mdr, &le->metablob, cur); - le->metablob.add_primary_dentry(cur->get_projected_parent_dn(), true, cur); + mdcache->journal_dirty_inode(mdr, &le->metablob, cur); journal_and_reply(mdr, cur, 0, le, new C_MDS_inode_update_finish(mds, mdr, cur)); }
Signature · 1 line
1.7.9.5
PATCH 2/2 mds: journal the projected root xattrs in add_root()
In reply to Kuan Kai ChiuIn EMetaBlob::add_root(), we should log the projected root xattrs instead of original ones to reflect xattr changes.
--- src/mds/events/EMetaBlob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/mds/events/EMetaBlob.h +1 -1
@@ -468,7 +468,7 @@ private:if (!pi) pi = in->get_projected_inode ();if (!pdft) pdft = &in->dirfragtree; -if (!px) px = &in->xattrs; +if (!px) px = in->get_projected_xattrs ();bufferlist snapbl;if (psnapbl)
Signature · 1 line
1.7.9.5
Thanks! I merged these into "next" (going to be Cuttlefish) in commits f379ce37bfdcb3670f52ef47c02787f82e50e612 and 87634d882fda80c4a2e3705c83a38bdfd613763f.
-Greg
Software Engineer #42 @ http://inktank.com | http://ceph.com
Quoted 21 lines · Kuan Kai Chiu
The first patch fixes a bug that causes MDS crash while setting or removing xattrs on root directory.
The second patch fixes another bug that root xattrs not correctly logged in MDS journal.
Kuan Kai Chiu (2):
mds: fix setting/removing xattrs on root
mds: journal the projected root xattrs inadd_root()src/mds/Server.cc | 6 ++---- src/mds/events/EMetaBlob.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)--
1.7.9.5--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html