Merge remote-tracking branch 'iommu/next'
[deliverable/linux.git] / fs / ext4 / fsync.c
index 5c4372512ef7139f722f60000e8550d27e2820d3..88effb1053c7d83680b60270f7273cc0112e7ab6 100644 (file)
@@ -61,6 +61,13 @@ static int ext4_sync_parent(struct inode *inode)
                        break;
                iput(inode);
                inode = next;
+               /*
+                * The directory inode may have gone through rmdir by now. But
+                * the inode itself and its blocks are still allocated (we hold
+                * a reference to the inode so it didn't go through
+                * ext4_evict_inode()) and so we are safe to flush metadata
+                * blocks and the inode.
+                */
                ret = sync_mapping_buffers(inode->i_mapping);
                if (ret)
                        break;
@@ -107,7 +114,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
 
        if (!journal) {
                ret = __generic_file_fsync(file, start, end, datasync);
-               if (!ret && !hlist_empty(&inode->i_dentry))
+               if (!ret)
                        ret = ext4_sync_parent(inode);
                if (test_opt(inode->i_sb, BARRIER))
                        goto issue_flush;
This page took 0.027198 seconds and 5 git commands to generate.