From: Abhi Das Date: Sun, 28 Jan 2018 23:02:51 -0600 Subject: [Cluster-devel] [GFS2 PATCH] gfs2: Remove inode from ordered write list in gfs2_write_inode() Message-ID: <1517202171-57481-1-git-send-email-adas@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- fs/gfs2/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index d81d46e..596feb6 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -766,6 +766,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; } -- 2.4.11