diff options
author | Sage Weil <sage@inktank.com> | 2013-02-05 16:52:29 -0500 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-04-02 22:33:52 -0400 |
commit | 752c8bdcfe88f27a17c5c9264df928fd145a4b30 (patch) | |
tree | 755eb2453b772e826113fe30d9184870efb012c0 /fs/ceph | |
parent | 180061a58c17681dd236e5059ba57fe092dbe368 (diff) |
ceph: do not chain inode updates to parent fsync
The fsync(dirfd) only covers namespace operations, not inode updates.
We do not need to cover setattr variants or O_TRUNC.
Reported-by: Al Viro <viro@xeniv.linux.org.uk>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 2 | ||||
-rw-r--r-- | fs/ceph/inode.c | 5 | ||||
-rw-r--r-- | fs/ceph/ioctl.c | 5 | ||||
-rw-r--r-- | fs/ceph/xattr.c | 10 |
4 files changed, 5 insertions, 17 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 09c7afe32e49..c298a7b8a1ce 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file) | |||
210 | ihold(inode); | 210 | ihold(inode); |
211 | 211 | ||
212 | req->r_num_caps = 1; | 212 | req->r_num_caps = 1; |
213 | if (flags & (O_CREAT|O_TRUNC)) | 213 | if (flags & O_CREAT) |
214 | parent_inode = ceph_get_dentry_parent_inode(file->f_dentry); | 214 | parent_inode = ceph_get_dentry_parent_inode(file->f_dentry); |
215 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | 215 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); |
216 | iput(parent_inode); | 216 | iput(parent_inode); |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 32d519d8a2e2..8bf2384bd423 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1627,7 +1627,6 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) | |||
1627 | { | 1627 | { |
1628 | struct inode *inode = dentry->d_inode; | 1628 | struct inode *inode = dentry->d_inode; |
1629 | struct ceph_inode_info *ci = ceph_inode(inode); | 1629 | struct ceph_inode_info *ci = ceph_inode(inode); |
1630 | struct inode *parent_inode; | ||
1631 | const unsigned int ia_valid = attr->ia_valid; | 1630 | const unsigned int ia_valid = attr->ia_valid; |
1632 | struct ceph_mds_request *req; | 1631 | struct ceph_mds_request *req; |
1633 | struct ceph_mds_client *mdsc = ceph_sb_to_client(dentry->d_sb)->mdsc; | 1632 | struct ceph_mds_client *mdsc = ceph_sb_to_client(dentry->d_sb)->mdsc; |
@@ -1819,9 +1818,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) | |||
1819 | req->r_inode_drop = release; | 1818 | req->r_inode_drop = release; |
1820 | req->r_args.setattr.mask = cpu_to_le32(mask); | 1819 | req->r_args.setattr.mask = cpu_to_le32(mask); |
1821 | req->r_num_caps = 1; | 1820 | req->r_num_caps = 1; |
1822 | parent_inode = ceph_get_dentry_parent_inode(dentry); | 1821 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
1823 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
1824 | iput(parent_inode); | ||
1825 | } | 1822 | } |
1826 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, | 1823 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, |
1827 | ceph_cap_string(dirtied), mask); | 1824 | ceph_cap_string(dirtied), mask); |
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index dc66c9e023e4..efbe08289292 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -64,7 +64,6 @@ static long __validate_layout(struct ceph_mds_client *mdsc, | |||
64 | static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | 64 | static long ceph_ioctl_set_layout(struct file *file, void __user *arg) |
65 | { | 65 | { |
66 | struct inode *inode = file_inode(file); | 66 | struct inode *inode = file_inode(file); |
67 | struct inode *parent_inode; | ||
68 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; | 67 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; |
69 | struct ceph_mds_request *req; | 68 | struct ceph_mds_request *req; |
70 | struct ceph_ioctl_layout l; | 69 | struct ceph_ioctl_layout l; |
@@ -121,9 +120,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | |||
121 | cpu_to_le32(l.object_size); | 120 | cpu_to_le32(l.object_size); |
122 | req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); | 121 | req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); |
123 | 122 | ||
124 | parent_inode = ceph_get_dentry_parent_inode(file->f_dentry); | 123 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
125 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
126 | iput(parent_inode); | ||
127 | ceph_mdsc_put_request(req); | 124 | ceph_mdsc_put_request(req); |
128 | return err; | 125 | return err; |
129 | } | 126 | } |
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index a55ec37378c6..2dbd668d590b 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c | |||
@@ -842,7 +842,6 @@ static int ceph_sync_setxattr(struct dentry *dentry, const char *name, | |||
842 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); | 842 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); |
843 | struct inode *inode = dentry->d_inode; | 843 | struct inode *inode = dentry->d_inode; |
844 | struct ceph_inode_info *ci = ceph_inode(inode); | 844 | struct ceph_inode_info *ci = ceph_inode(inode); |
845 | struct inode *parent_inode; | ||
846 | struct ceph_mds_request *req; | 845 | struct ceph_mds_request *req; |
847 | struct ceph_mds_client *mdsc = fsc->mdsc; | 846 | struct ceph_mds_client *mdsc = fsc->mdsc; |
848 | int err; | 847 | int err; |
@@ -893,9 +892,7 @@ static int ceph_sync_setxattr(struct dentry *dentry, const char *name, | |||
893 | req->r_data_len = size; | 892 | req->r_data_len = size; |
894 | 893 | ||
895 | dout("xattr.ver (before): %lld\n", ci->i_xattrs.version); | 894 | dout("xattr.ver (before): %lld\n", ci->i_xattrs.version); |
896 | parent_inode = ceph_get_dentry_parent_inode(dentry); | 895 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
897 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
898 | iput(parent_inode); | ||
899 | ceph_mdsc_put_request(req); | 896 | ceph_mdsc_put_request(req); |
900 | dout("xattr.ver (after): %lld\n", ci->i_xattrs.version); | 897 | dout("xattr.ver (after): %lld\n", ci->i_xattrs.version); |
901 | 898 | ||
@@ -1019,7 +1016,6 @@ static int ceph_send_removexattr(struct dentry *dentry, const char *name) | |||
1019 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); | 1016 | struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); |
1020 | struct ceph_mds_client *mdsc = fsc->mdsc; | 1017 | struct ceph_mds_client *mdsc = fsc->mdsc; |
1021 | struct inode *inode = dentry->d_inode; | 1018 | struct inode *inode = dentry->d_inode; |
1022 | struct inode *parent_inode; | ||
1023 | struct ceph_mds_request *req; | 1019 | struct ceph_mds_request *req; |
1024 | int err; | 1020 | int err; |
1025 | 1021 | ||
@@ -1033,9 +1029,7 @@ static int ceph_send_removexattr(struct dentry *dentry, const char *name) | |||
1033 | req->r_num_caps = 1; | 1029 | req->r_num_caps = 1; |
1034 | req->r_path2 = kstrdup(name, GFP_NOFS); | 1030 | req->r_path2 = kstrdup(name, GFP_NOFS); |
1035 | 1031 | ||
1036 | parent_inode = ceph_get_dentry_parent_inode(dentry); | 1032 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
1037 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
1038 | iput(parent_inode); | ||
1039 | ceph_mdsc_put_request(req); | 1033 | ceph_mdsc_put_request(req); |
1040 | return err; | 1034 | return err; |
1041 | } | 1035 | } |