From: Abhi Das Date: Tue, 30 Jan 2018 17:00:09 +0000 (-0700) Subject: gfs2: Remove inode from ordered write list in gfs2_write_inode() X-Git-Tag: Ubuntu-5.10.0-12.13~8556^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=957a7acd46e64c52d2a1d59cd7273ed49455afb6;p=mirror_ubuntu-hirsute-kernel.git 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 Signed-off-by: Bob Peterson --- 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; }