Ticket #40 (assigned bug)

Opened 4 weeks ago

Last modified 4 days ago

"noatime" (and possibly other) mount options ignored

Reported by: carns Assigned to: carns (accepted)
Priority: major Component: kmod
Version: HEAD Keywords: noatime mount option suid
Cc:

Description

PVFS supports a few mount time options, including "noatime". However, this option is being ignored.

applied this hack to confirm:

Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-utils.c,v
retrieving revision 1.151
diff -a -u -p -r1.151 pvfs2-utils.c
--- pvfs2-utils.c       25 Mar 2008 19:21:22 -0000      1.151
+++ pvfs2-utils.c       23 Apr 2008 14:01:12 -0000
@@ -430,6 +430,13 @@ int pvfs2_inode_getattr(struct inode *in
     pvfs2_kernel_op_t *new_op = NULL;
     pvfs2_inode_t *pvfs2_inode = NULL;
 
+    gossip_err("FOO: inode_getattr() called.\n");
+    gossip_err("inode->i_sb->s_flags: %lu.\n", inode->i_sb->s_flags);
+    if(inode->i_sb->s_flags & MS_NOATIME)
+        gossip_err("FOO: inode->i_sb->s_flags include NOATIME.\n");
+    else
+        gossip_err("FOO: inode->i_sb->s_flags DON'T include NOATIME.\n");
+
     gossip_debug(GOSSIP_UTILS_DEBUG, "pvfs2_inode_getattr: called on inode %llu\n",
                 llu(get_handle_from_ino(inode)));
 
Index: super.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/super.c,v
retrieving revision 1.97
diff -a -u -p -r1.97 super.c
--- super.c     19 Feb 2008 17:38:09 -0000      1.97
+++ super.c     23 Apr 2008 14:01:12 -0000
@@ -1066,6 +1066,13 @@ int pvfs2_fill_sb(
         sb->s_flags = (sb->s_flags & ~(MS_POSIXACL | MS_NOATIME | MS_NODIRATIME));
     }
 
+    gossip_err("FOO: sb->s_flags: %lu\n", sb->s_flags);
+    if(sb->s_flags & MS_NOATIME)
+        gossip_err("FOO: sb->s_flags include NOATIME.\n");
+    else
+        gossip_err("FOO: sb->s_flags DON'T include NOATIME.\n");
+        
+
 #if defined(HAVE_GENERIC_GETXATTR) && defined(CONFIG_FS_POSIX_ACL)
     /* Hang the xattr handlers off the superblock */
     sb->s_xattr = pvfs2_xattr_handlers;

Output in dmesg confirms that -o noatime option is having no affect on the appropriate superblock flags. Suspect that "suid" option is also being ignored.

Attachments

noatime.patch (2.3 kB) - added by carns on 05/09/08 11:34:44.
hacked noatime support patch

Change History

04/23/08 16:34:56 changed by carns

  • owner changed from slang to carns.

At least in modern kernels, common supported options like "noatime" have already been parsed out of the options string before we get to the pvfs2_fill_sb() function. It looks like we might just need to pull/check the flag from the appropriate place.

Also noticed that the pvfs2_fil_sb() function does not currently throw an error at mount time if an unknown option is requested. This seems like a bad idea.

05/01/08 13:18:41 changed by carns

  • status changed from new to assigned.

Added fix to trunk to make mount fail if an unsupported option is used.

05/09/08 11:34:08 changed by carns

Attached patch makes the noatime mount option work correctly, but this isn't clean yet. The getattr() operation is the only place where we appear to be able to determine (within the pvfs kernel module) that the noatime mount option was used. It looks like nowadays the VFS tries to use that information without involving the file system implementation (though in our case we need to know in order to deal with our close semantics properly).

05/09/08 11:34:44 changed by carns

  • attachment noatime.patch added.

hacked noatime support patch

05/14/08 14:06:03 changed by carns

Also need to check to see if ctime/mtime/atime are flushed after opening and closing a new (empty) file. This should not be necessary regardless of noatime setting.