summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAbhi Das <adas@redhat.com>2018-01-30 10:00:09 -0700
committerBob Peterson <rpeterso@redhat.com>2018-01-30 10:00:27 -0700
commit957a7acd46e64c52d2a1d59cd7273ed49455afb6 (patch)
tree799a8c20a32b18690203eb0f69f71a83cc1d2ff2 /fs
parent2eb5909dee9bcce9c0befdef48c00f1132d9de2e (diff)
downloadlinux-957a7acd46e64c52d2a1d59cd7273ed49455afb6.tar.bz2
gfs2: Remove inode from ordered write list in gfs2_write_inode()
The vfs clears the I_DIRTY inode flag before calling gfs2_write_inode() having queued any data that needed to be written to disk. This is a good time to remove such inodes from our ordered write list so they don't hang around for long periods of time. Signed-off-by: Abhi Das <adas@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/super.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 50a297b920fc..620be0521866 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -768,6 +768,12 @@ static int gfs2_write_inode(struct inode *inode, struct writeback_control *wbc)
ret = filemap_fdatawait(metamapping);
if (ret)
mark_inode_dirty_sync(inode);
+ else {
+ spin_lock(&inode->i_lock);
+ if (!(inode->i_flags & I_DIRTY))
+ gfs2_ordered_del_inode(ip);
+ spin_unlock(&inode->i_lock);
+ }
return ret;
}