Skip to content

Commit

Permalink
ceph: don't BUG on ENOMEM during mds reconnect
Browse files Browse the repository at this point in the history
We are in a position to return an error; do that instead.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Aug 26, 2010
1 parent f44c389 commit e072f8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2324,15 +2324,15 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
path = ceph_mdsc_build_path(dentry, &pathlen, &pathbase, 0);
if (IS_ERR(path)) {
err = PTR_ERR(path);
BUG_ON(err);
goto out_dput;
}
} else {
path = NULL;
pathlen = 0;
}
err = ceph_pagelist_encode_string(pagelist, path, pathlen);
if (err)
goto out;
goto out_free;

spin_lock(&inode->i_lock);
cap->seq = 0; /* reset cap seq */
Expand Down Expand Up @@ -2376,8 +2376,9 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
unlock_kernel();
}

out:
out_free:
kfree(path);
out_dput:
dput(dentry);
return err;
}
Expand Down

0 comments on commit e072f8a

Please sign in to comment.