Skip to content

Commit

Permalink
ceph: tolerate (and warn on) extraneous dentry from mds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed Aug 21, 2012
1 parent d1c338a commit 6c5e50f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,18 +992,23 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
if (rinfo->head->is_dentry) {
struct inode *dir = req->r_locked_dir;

err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
session, req->r_request_started, -1,
&req->r_caps_reservation);
if (err < 0)
return err;
if (dir) {
err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
session, req->r_request_started, -1,
&req->r_caps_reservation);
if (err < 0)
return err;
} else {
WARN_ON_ONCE(1);
}
}

/*
* ignore null lease/binding on snapdir ENOENT, or else we
* will have trouble splicing in the virtual snapdir later
*/
if (rinfo->head->is_dentry && !req->r_aborted &&
req->r_locked_dir &&
(rinfo->head->is_target || strncmp(req->r_dentry->d_name.name,
fsc->mount_options->snapdir_name,
req->r_dentry->d_name.len))) {
Expand Down

0 comments on commit 6c5e50f

Please sign in to comment.