public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* RHEL5 - gfs-kernel and mount.gfs2: GFS ignore the noatime and nodiratime mount options
@ 2008-10-14  4:28 Abhijith Das
  0 siblings, 0 replies; only message in thread
From: Abhijith Das @ 2008-10-14  4:28 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ea8e447f55864271a645a0b5ab32fb383bb8ad96
Commit:        ea8e447f55864271a645a0b5ab32fb383bb8ad96
Parent:        33ac113b87bc000cb801de2a9f6f2bfe2f20cf22
Author:        Abhijith Das <adas@redhat.com>
AuthorDate:    Mon Oct 13 23:24:47 2008 -0500
Committer:     Abhijith Das <adas@redhat.com>
CommitterDate: Mon Oct 13 23:24:47 2008 -0500

gfs-kernel and mount.gfs2: GFS ignore the noatime and nodiratime mount options

Since the vfs moved the MS_NOATIME, MS_NODIRATIME flags
from the superblock to the vfsmount structure (MNT_NOATIME,
MNT_NODIRATIME, which are not accessible to gfs), gfs no
longer knows when to enable/disable atime updates and the
atime_quantum stuff is broken in the sense that it doesn't
respect the noatime and nodiratime flags.

This patch attempts to fix this by creating a gfs-specific
mount option gfs_noatime and having the mount.gfs helper
pass it along when the user specifies noatime or nodiratime
in the command line. It's not the ideal way to fix it, and
it is a bit ugly.
---
 gfs-kernel/src/gfs/incore.h     |    1 +
 gfs-kernel/src/gfs/mount.c      |    3 +++
 gfs-kernel/src/gfs/ops_fstype.c |    2 +-
 gfs2/mount/mount.gfs2.c         |    1 +
 gfs2/mount/util.c               |    7 +++++++
 5 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/gfs-kernel/src/gfs/incore.h b/gfs-kernel/src/gfs/incore.h
index 09c5f50..633e9ca 100644
--- a/gfs-kernel/src/gfs/incore.h
+++ b/gfs-kernel/src/gfs/incore.h
@@ -856,6 +856,7 @@ struct gfs_args {
 	int ar_posix_acls; /* Enable posix acls */
 	int ar_suiddir; /* suiddir support */
 	int ar_noquota; /* Turn off quota support */
+	int ar_noatime; /* Turn off atime updates */
 };
 
 struct gfs_tune {
diff --git a/gfs-kernel/src/gfs/mount.c b/gfs-kernel/src/gfs/mount.c
index 8ffa89f..8dd58e8 100644
--- a/gfs-kernel/src/gfs/mount.c
+++ b/gfs-kernel/src/gfs/mount.c
@@ -156,6 +156,9 @@ gfs_make_args(char *data_arg, struct gfs_args *args, int remount)
 		else if (!strcmp(x, "noquota"))
 			args->ar_noquota = TRUE;
 
+		else if (!strcmp(x, "gfs_noatime"))
+			args->ar_noatime = TRUE;
+
 		/*  Unknown  */
 
 		else {
diff --git a/gfs-kernel/src/gfs/ops_fstype.c b/gfs-kernel/src/gfs/ops_fstype.c
index e01ea32..4f0b471 100644
--- a/gfs-kernel/src/gfs/ops_fstype.c
+++ b/gfs-kernel/src/gfs/ops_fstype.c
@@ -648,7 +648,7 @@ static int fill_super(struct super_block *sb, void *data, int silent)
 
 	/*  Copy VFS mount flags  */
 
-	if (sb->s_flags & (MS_NOATIME | MS_NODIRATIME))
+	if (sdp->sd_args.ar_noatime)
 		set_bit(SDF_NOATIME, &sdp->sd_flags);
 	if (sb->s_flags & MS_RDONLY)
 		set_bit(SDF_ROFS, &sdp->sd_flags);
diff --git a/gfs2/mount/mount.gfs2.c b/gfs2/mount/mount.gfs2.c
index 22378a2..4097915 100644
--- a/gfs2/mount/mount.gfs2.c
+++ b/gfs2/mount/mount.gfs2.c
@@ -203,6 +203,7 @@ int main(int argc, char **argv)
 		die("invalid mount helper name \"%s\"\n", prog_name);
 
 	fsname = (strstr(prog_name, "gfs2")) ? "gfs2" : "gfs";
+	strcpy(mo.type, fsname);
 
 	if (argc < 2) {
 		print_usage();
diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c
index cbb2973..027250d 100644
--- a/gfs2/mount/util.c
+++ b/gfs2/mount/util.c
@@ -151,6 +151,13 @@ void parse_opts(struct mount_options *mo)
 		}
 	}
 
+	/* Hack to get the noatime/nodiratime option through to gfs */
+	if ((mo->flags & (MS_NOATIME | MS_NODIRATIME)) &&
+	    (strcmp(mo->type, "gfs") == 0)) {
+		strcat(mo->extra, "gfs_noatime");
+		extra_len += strlen("gfs_noatime");
+	}
+
 	log_debug("parse_opts: flags = %x", mo->flags);
 	log_debug("parse_opts: extra = \"%s\"", mo->extra);
 	log_debug("parse_opts: hostdata = \"%s\"", mo->hostdata);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-14  4:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-14  4:28 RHEL5 - gfs-kernel and mount.gfs2: GFS ignore the noatime and nodiratime mount options Abhijith Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).