diff mbox series

ceph_fill_trace(): add missing check in d_revalidate snapdir handling

Message ID 20191029135329.GI26530@ZenIV.linux.org.uk (mailing list archive)
State New, archived
Headers show
Series ceph_fill_trace(): add missing check in d_revalidate snapdir handling | expand

Commit Message

Al Viro Oct. 29, 2019, 1:53 p.m. UTC
[resent to correct address]

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

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Comments

Jeff Layton Oct. 30, 2019, 1:49 p.m. UTC | #1
On Tue, 2019-10-29 at 13:53 +0000, Al Viro wrote:
> [resent to correct address]
> 
> we should not play with dcache without parent locked...
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> 
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index 9f135624ae47..c07407586ce8 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -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.
diff mbox series

Patch

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 9f135624ae47..c07407586ce8 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -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;