[Vserver] [PATCH 08/10] vfs: make touch/atime functions correctly regard vfsmount RO flag

From: Sam Vilain <sam.vilain_at_catalyst.net.nz>
Date: Mon 27 Feb 2006 - 05:25:32 GMT
Message-Id: <20060227052532.21148.70191.stgit@wilber.wgtn.cat-it.co.nz>

Previously, only the inode's idea of a read-only flag was considered
for touch_atime() and file_update_time(). Add a call to the
MNT_IS_RDONLY macro to correctly exclude this update on read-only
vfsmounts.

---
 fs/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/inode.c b/fs/inode.c
index d0be615..2d26a4e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1190,7 +1190,7 @@ void touch_atime(struct vfsmount *mnt, s
 	struct inode *inode = dentry->d_inode;
 	struct timespec now;
 
-	if (IS_RDONLY(inode))
+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt))
 		return;
 
 	if ((inode->i_flags & S_NOATIME) ||
@@ -1235,7 +1235,7 @@ void file_update_time(struct file *file)
 
 	if (IS_NOCMTIME(inode))
 		return;
-	if (IS_RDONLY(inode))
+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(file->f_vfsmnt))
 		return;
 
 	now = current_fs_time(inode->i_sb);
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Mon Feb 27 05:42:03 2006
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 27 Feb 2006 - 05:42:05 GMT by hypermail 2.1.8