aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/fsync.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r--fs/ext4/fsync.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index bb6c7d811313..2a1dcea4f12e 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -135,14 +135,7 @@ static int ext4_sync_parent(struct inode *inode)
135 inode = igrab(inode); 135 inode = igrab(inode);
136 while (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) { 136 while (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {
137 ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY); 137 ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);
138 dentry = NULL; 138 dentry = d_find_any_alias(inode);
139 spin_lock(&inode->i_lock);
140 if (!list_empty(&inode->i_dentry)) {
141 dentry = list_first_entry(&inode->i_dentry,
142 struct dentry, d_alias);
143 dget(dentry);
144 }
145 spin_unlock(&inode->i_lock);
146 if (!dentry) 139 if (!dentry)
147 break; 140 break;
148 next = igrab(dentry->d_parent->d_inode); 141 next = igrab(dentry->d_parent->d_inode);
@@ -232,7 +225,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
232 225
233 if (!journal) { 226 if (!journal) {
234 ret = __sync_inode(inode, datasync); 227 ret = __sync_inode(inode, datasync);
235 if (!ret && !list_empty(&inode->i_dentry)) 228 if (!ret && !hlist_empty(&inode->i_dentry))
236 ret = ext4_sync_parent(inode); 229 ret = ext4_sync_parent(inode);
237 goto out; 230 goto out;
238 } 231 }