public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] flush inode when changing atime.
@ 2007-10-17  4:56 Utako Kusaka
  2007-10-17  9:08 ` David Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Utako Kusaka @ 2007-10-17  4:56 UTC (permalink / raw)
  To: xfs

Hi,

The atime is changed for reading but it returns to a previous value
after unmount. i_update_core is still off after reading a file using
read(), readdir() and readlink(). So an inode isn't flushed to disk.

I referred to following fix when I made a patch:
TAKE 946679 - fix, speedup and simplify atime handling
http://marc.info/?l=linux-xfs&m=113398234310217&w=4

Example:
# ls -lu mpnt/log3
-rw-r--r--  1 root root 63494 2007-04-05 16:35 mpnt/log3
# less mpnt/log3
# ls -lu mpnt/log3
-rw-r--r--  1 root root 63494 2007-10-05 15:27 mpnt/log3
# umount mpnt/
# mount -t xfs /dev/sda6 mpnt
# ls -lu mpnt/log3
-rw-r--r--  1 root root 63494 2007-04-05 16:35 mpnt/log3

--
Utako

Signed-off-by: Utako Kusaka <u-kusaka@wm.jp.nec.com>
----------
--- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c	2007-10-15 15:50:10.000000000 +0900
+++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c	2007-10-15 16:49:35.000000000 +0900
@@ -1003,6 +1003,8 @@ xfs_readlink(
 		error = xfs_readlink_bmap(ip, link);
 	}
 
+	ip->i_update_core = 1;
+
  out:
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
 	return error;
--- linux-2.6-xfs.orig/fs/xfs/xfs_dir2.c	2007-10-15 15:50:09.000000000 +0900
+++ linux-2.6-xfs/fs/xfs/xfs_dir2.c	2007-10-15 16:48:47.000000000 +0900
@@ -318,6 +318,9 @@ xfs_readdir(
 	else
 		rval = xfs_dir2_leaf_getdents(dp, dirent, bufsize, offset,
 					      filldir);
+
+	dp->i_update_core = 1;
+
 	return rval;
 }
 
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c	2007-10-15 15:50:10.000000000 +0900
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c	2007-10-15 16:50:50.000000000 +0900
@@ -275,6 +275,9 @@ xfs_read(
 		XFS_STATS_ADD(xs_read_bytes, ret);
 
 	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
+
+	if (likely(!(ioflags & IO_INVIS)))
+		ip->i_update_core = 1;
 	return ret;
 }
 
----------

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-18  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17  4:56 [PATCH] flush inode when changing atime Utako Kusaka
2007-10-17  9:08 ` David Chinner
2007-10-18  3:52   ` Lachlan McIlroy
2007-10-18  4:17     ` David Chinner
2007-10-18  8:01       ` Lachlan McIlroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox