PAGECACHE_TAG_DIRTY is the authoritative source of information about any folio being dirty in the mapping. I_DIRTY_PAGES is just an approximation used by writeback code that can get stale under certain situations. So just rely on the authoritative check. Signed-off-by: Jan Kara --- fs/xfs/xfs_reflink.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_reflink.h b/fs/xfs/xfs_reflink.h index 683c1841e640..1310cc9fe829 100644 --- a/fs/xfs/xfs_reflink.h +++ b/fs/xfs/xfs_reflink.h @@ -17,8 +17,7 @@ xfs_can_free_cowblocks(struct xfs_inode *ip) { struct inode *inode = VFS_I(ip); - if ((inode_state_read_once(inode) & I_DIRTY_PAGES) || - mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY) || + if (mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY) || mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK) || atomic_read(&inode->i_dio_count)) return false; -- 2.53.0