Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79aec984 authored by Sam Lang's avatar Sam Lang Committed by Alex Elder
Browse files

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: default avatarSam Lang <sam.lang@inktank.com>
Reviewed-by: default avatarSage Weil <sage@inktank.com>
parent 0fa6ebc6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);