[patch 15/22] elevate write count for file_update_time()
Cedric Le Goater
clg at fr.ibm.com
Thu Jun 7 08:25:42 PDT 2007
From: Dave Hansen <hansendc at us.ibm.com>
Signed-off-by: Dave Hansen <hansendc at us.ibm.com>
---
---
fs/inode.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: 2.6.22-rc4-mm2-robindmount/fs/inode.c
===================================================================
--- 2.6.22-rc4-mm2-robindmount.orig/fs/inode.c
+++ 2.6.22-rc4-mm2-robindmount/fs/inode.c
@@ -1232,10 +1232,13 @@ void file_update_time(struct file *file)
struct inode *inode = file->f_path.dentry->d_inode;
struct timespec now;
int sync_it = 0;
+ int err = 0;
if (IS_NOCMTIME(inode))
return;
- if (IS_RDONLY(inode))
+ if (file->f_vfsmnt)
+ err = mnt_want_write(file->f_vfsmnt);
+ if (err)
return;
now = current_fs_time(inode->i_sb);
@@ -1251,6 +1254,8 @@ void file_update_time(struct file *file)
if (sync_it)
mark_inode_dirty_sync(inode);
+ if (file->f_vfsmnt)
+ mnt_drop_write(file->f_vfsmnt);
}
EXPORT_SYMBOL(file_update_time);
--
More information about the Containers
mailing list