diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 5d893d31e399..62377ec37edf 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -677,6 +677,7 @@ static int fill_inode(struct inode *inode, | |||
677 | if (ci->i_files == 0 && ci->i_subdirs == 0 && | 677 | if (ci->i_files == 0 && ci->i_subdirs == 0 && |
678 | ceph_snap(inode) == CEPH_NOSNAP && | 678 | ceph_snap(inode) == CEPH_NOSNAP && |
679 | (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && | 679 | (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && |
680 | (issued & CEPH_CAP_FILE_EXCL) == 0 && | ||
680 | (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { | 681 | (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { |
681 | dout(" marking %p complete (empty)\n", inode); | 682 | dout(" marking %p complete (empty)\n", inode); |
682 | ci->i_ceph_flags |= CEPH_I_COMPLETE; | 683 | ci->i_ceph_flags |= CEPH_I_COMPLETE; |
@@ -844,7 +845,7 @@ static void ceph_set_dentry_offset(struct dentry *dn) | |||
844 | * the caller) if we fail. | 845 | * the caller) if we fail. |
845 | */ | 846 | */ |
846 | static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | 847 | static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, |
847 | bool *prehash) | 848 | bool *prehash, bool set_offset) |
848 | { | 849 | { |
849 | struct dentry *realdn; | 850 | struct dentry *realdn; |
850 | 851 | ||
@@ -876,7 +877,8 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | |||
876 | } | 877 | } |
877 | if ((!prehash || *prehash) && d_unhashed(dn)) | 878 | if ((!prehash || *prehash) && d_unhashed(dn)) |
878 | d_rehash(dn); | 879 | d_rehash(dn); |
879 | ceph_set_dentry_offset(dn); | 880 | if (set_offset) |
881 | ceph_set_dentry_offset(dn); | ||
880 | out: | 882 | out: |
881 | return dn; | 883 | return dn; |
882 | } | 884 | } |
@@ -1061,7 +1063,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
1061 | d_delete(dn); | 1063 | d_delete(dn); |
1062 | goto done; | 1064 | goto done; |
1063 | } | 1065 | } |
1064 | dn = splice_dentry(dn, in, &have_lease); | 1066 | dn = splice_dentry(dn, in, &have_lease, true); |
1065 | if (IS_ERR(dn)) { | 1067 | if (IS_ERR(dn)) { |
1066 | err = PTR_ERR(dn); | 1068 | err = PTR_ERR(dn); |
1067 | goto done; | 1069 | goto done; |
@@ -1104,7 +1106,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
1104 | goto done; | 1106 | goto done; |
1105 | } | 1107 | } |
1106 | dout(" linking snapped dir %p to dn %p\n", in, dn); | 1108 | dout(" linking snapped dir %p to dn %p\n", in, dn); |
1107 | dn = splice_dentry(dn, in, NULL); | 1109 | dn = splice_dentry(dn, in, NULL, true); |
1108 | if (IS_ERR(dn)) { | 1110 | if (IS_ERR(dn)) { |
1109 | err = PTR_ERR(dn); | 1111 | err = PTR_ERR(dn); |
1110 | goto done; | 1112 | goto done; |
@@ -1229,14 +1231,14 @@ retry_lookup: | |||
1229 | in = dn->d_inode; | 1231 | in = dn->d_inode; |
1230 | } else { | 1232 | } else { |
1231 | in = ceph_get_inode(parent->d_sb, vino); | 1233 | in = ceph_get_inode(parent->d_sb, vino); |
1232 | if (in == NULL) { | 1234 | if (IS_ERR(in)) { |
1233 | dout("new_inode badness\n"); | 1235 | dout("new_inode badness\n"); |
1234 | d_delete(dn); | 1236 | d_delete(dn); |
1235 | dput(dn); | 1237 | dput(dn); |
1236 | err = -ENOMEM; | 1238 | err = PTR_ERR(in); |
1237 | goto out; | 1239 | goto out; |
1238 | } | 1240 | } |
1239 | dn = splice_dentry(dn, in, NULL); | 1241 | dn = splice_dentry(dn, in, NULL, false); |
1240 | if (IS_ERR(dn)) | 1242 | if (IS_ERR(dn)) |
1241 | dn = NULL; | 1243 | dn = NULL; |
1242 | } | 1244 | } |