ceph: drop extra open file reference in ceph_atomic_open()
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 1 Apr 2014 12:20:17 +0000 (20:20 +0800)
committerSage Weil <sage@inktank.com>
Sat, 5 Apr 2014 04:08:23 +0000 (21:08 -0700)
ceph_atomic_open() calls ceph_open() after receiving the MDS reply.
ceph_open() grabs an extra open file reference. (The open request
already holds an open file reference)

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
fs/ceph/file.c

index 2862a75fb9498ff8774f28cde4eb843d2b8cf658..66075a4ad97900edbfaf98775d484c31c7496200 100644 (file)
@@ -291,8 +291,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
                }
                err = finish_open(file, dentry, ceph_open, opened);
        }
-
 out_err:
+       if (!req->r_err && req->r_target_inode)
+               ceph_put_fmode(ceph_inode(req->r_target_inode), req->r_fmode);
        ceph_mdsc_put_request(req);
        dout("atomic_open result=%d\n", err);
        return err;