From: Yan, Zheng Date: Mon, 19 Jan 2015 05:23:20 +0000 (+0800) Subject: ceph: fix atomic_open snapdir X-Git-Tag: v4.0-rc1~34^2~10 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bf91c3150880ed6304f578cf00bd408d642fe6a0;p=linux-2.6-block.git ceph: fix atomic_open snapdir ceph_handle_snapdir() checks ceph_mdsc_do_request()'s return value and creates snapdir inode if it's -ENOENT Signed-off-by: Yan, Zheng --- diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c407abb52b7b..848969ee24db 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -275,10 +275,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ? dir : NULL, req); + err = ceph_handle_snapdir(req, dentry, err); if (err) goto out_req; - 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);