Skip to contentSkip to conversation

ceph_fill_trace(): add missing check in d_revalidate snapdir handling

PATCH In review Al Viro 2 participants 2 messages Oct 29, 2019 – Oct 30, 2019

Subsystems (2)
lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

PATCH 1/1 ceph_fill_trace(): add missing check in d_revalidate snapdir handling

[resent to correct address]

we should not play with dcache without parent locked...

fs/ceph/inode.c +1 -0
index 9f135624ae47..c07407586ce8 100644
@@ -1434,6 +1434,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
 		dout(" final dn %p\n", dn);
 	} else if ((req->r_op == CEPH_MDS_OP_LOOKUPSNAP ||
 		    req->r_op == CEPH_MDS_OP_MKSNAP) &&
+	           test_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags) &&
 		   !test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) {
 		struct inode *dir = req->r_parent;
 
#1 lore raw
Quoted 11 lines · Al Viro

[resent to correct address]

we should not play with dcache without parent locked...

fs/ceph/inode.c +0 -0
index 9f135624ae47..c07407586ce8 100644

fs/ceph/inode.c int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req) · line 1440

Quoted 7 lines
fs/ceph/inode.c +1 -0
@@ -1434,6 +1434,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
 		dout(" final dn %p\n", dn);
 	} else if ((req->r_op == CEPH_MDS_OP_LOOKUPSNAP ||
 		    req->r_op == CEPH_MDS_OP_MKSNAP) &&
+	           test_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags) &&
 		   !test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) {
 		struct inode *dir = req->r_parent;
 

Thanks Al.

Both patches merged and marked for stable. Ilya should send a PR to Linus with these within the next week or so.

Signature · 1 line
Jeff Layton <[email protected]>