Currently we're not writting atime updates back to disk on unmount
if it's the only change that happened. One solution would be to implement
->dirty_inode() but that might be overkill and has a perf hit, instead
just tag as needed for update in reclaim()
Signed-off-by: Niv Sardi <xaiki@xxxxxxxxxx>
---
fs/xfs/xfs_vnodeops.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index e257f65..828d398 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -2840,6 +2840,7 @@ int
xfs_reclaim(
xfs_inode_t *ip)
{
+ struct inode *inode = VFS_I(ip);
xfs_itrace_entry(ip);
@@ -2856,10 +2857,13 @@ xfs_reclaim(
ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);
/*
- * Make sure the atime in the XFS inode is correct before freeing the
- * Linux inode.
+ * Mark dirty and update atime only if different from the linux inode
one.
*/
- xfs_synchronize_atime(ip);
+ if (! timespec_equal(&inode->i_atime,
+ (struct timespec *) &ip->i_d.di_atime)) {
+ xfs_synchronize_atime(ip);
+ ip->i_update_core = 1;
+ }
/*
* If we have nothing to flush with this inode then complete the
--
1.5.6.2
--=-=-=
--
Niv Sardi
--=-=-=--
|