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>
This commit is contained in:
@@ -992,11 +992,15 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
|
|||||||
if (rinfo->head->is_dentry) {
|
if (rinfo->head->is_dentry) {
|
||||||
struct inode *dir = req->r_locked_dir;
|
struct inode *dir = req->r_locked_dir;
|
||||||
|
|
||||||
err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
|
if (dir) {
|
||||||
session, req->r_request_started, -1,
|
err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
|
||||||
&req->r_caps_reservation);
|
session, req->r_request_started, -1,
|
||||||
if (err < 0)
|
&req->r_caps_reservation);
|
||||||
return err;
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
} else {
|
||||||
|
WARN_ON_ONCE(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1004,6 +1008,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
|
|||||||
* will have trouble splicing in the virtual snapdir later
|
* will have trouble splicing in the virtual snapdir later
|
||||||
*/
|
*/
|
||||||
if (rinfo->head->is_dentry && !req->r_aborted &&
|
if (rinfo->head->is_dentry && !req->r_aborted &&
|
||||||
|
req->r_locked_dir &&
|
||||||
(rinfo->head->is_target || strncmp(req->r_dentry->d_name.name,
|
(rinfo->head->is_target || strncmp(req->r_dentry->d_name.name,
|
||||||
fsc->mount_options->snapdir_name,
|
fsc->mount_options->snapdir_name,
|
||||||
req->r_dentry->d_name.len))) {
|
req->r_dentry->d_name.len))) {
|
||||||
|
Reference in New Issue
Block a user