Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: tolerate (and warn on) extraneous dentry from mds

If the MDS gives us a dentry and we weren't prepared to handle it,
WARN_ON_ONCE instead of crashing.

Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>

Sage Weil 6c5e50fa d1c338a5

+10 -5
+10 -5
fs/ceph/inode.c
··· 992 992 if (rinfo->head->is_dentry) { 993 993 struct inode *dir = req->r_locked_dir; 994 994 995 - err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag, 996 - session, req->r_request_started, -1, 997 - &req->r_caps_reservation); 998 - if (err < 0) 999 - return err; 995 + if (dir) { 996 + err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag, 997 + session, req->r_request_started, -1, 998 + &req->r_caps_reservation); 999 + if (err < 0) 1000 + return err; 1001 + } else { 1002 + WARN_ON_ONCE(1); 1003 + } 1000 1004 } 1001 1005 1002 1006 /* ··· 1008 1004 * will have trouble splicing in the virtual snapdir later 1009 1005 */ 1010 1006 if (rinfo->head->is_dentry && !req->r_aborted && 1007 + req->r_locked_dir && 1011 1008 (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name, 1012 1009 fsc->mount_options->snapdir_name, 1013 1010 req->r_dentry->d_name.len))) {