summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorSam Lang2012-12-19 20:44:23 +0100
committerAlex Elder2013-01-17 19:42:36 +0100
commit79aec9844de339531f05b019644ccaf5dd777144 (patch)
tree319409adbac648492c7d48f6d0ce2a97a255a537 /fs/ceph/file.c
parentlibceph: fix protocol feature mismatch failure path (diff)
downloadkernel-qcow2-linux-79aec9844de339531f05b019644ccaf5dd777144.tar.gz
kernel-qcow2-linux-79aec9844de339531f05b019644ccaf5dd777144.tar.xz
kernel-qcow2-linux-79aec9844de339531f05b019644ccaf5dd777144.zip
ceph: Check for err on mds request in atomic_open
The error returned by ceph_mdsc_do_request includes errors sending the request, errors on timeout, or any errors coming from the mds. If ceph_mdsc_do_request returns an error, the reply struct will most likely be bogus. We need to bail out and propogate the error instead of overwriting it. Signed-off-by: Sam Lang <sam.lang@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index d415096800a6..2c71cbd78332 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -243,6 +243,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
err = ceph_mdsc_do_request(mdsc,
(flags & (O_CREAT|O_TRUNC)) ? dir : NULL,
req);
+ if (err)
+ goto out_err;
+
err = ceph_handle_snapdir(req, dentry, err);
if (err == 0 && (flags & O_CREAT) && !req->r_reply_info.head->is_dentry)
err = ceph_handle_notrace_create(dir, dentry);