OpenVZ Forum


Home » Mailing lists » Devel » [patch 15/22] elevate write count for file_update_time()
[patch 15/22] elevate write count for file_update_time() [message #18815] Thu, 07 June 2007 15:25
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
From: Dave Hansen <hansendc@us.ibm.com>

Signed-off-by: Dave Hansen <hansendc@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);

-- 
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [patch 14/22] elevate mount count for extended attributes
Next Topic: [patch 16/22] unix_find_other() elevate write count for touch_atime()
Goto Forum:
  


Current Time: Thu Aug 28 00:12:52 GMT 2025

Total time taken to generate the page: 0.11662 seconds