From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22830 invoked by alias); 14 Oct 2008 04:28:35 -0000 Received: (qmail 22821 invoked by alias); 14 Oct 2008 04:28:34 -0000 X-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,BAYES_20,J_CHICKENPOX_43,J_CHICKENPOX_53,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: RHEL5 - gfs-kernel and mount.gfs2: GFS ignore the noatime and nodiratime mount options To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 33ac113b87bc000cb801de2a9f6f2bfe2f20cf22 X-Git-Newrev: ea8e447f55864271a645a0b5ab32fb383bb8ad96 From: Abhijith Das Message-Id: <20081014042723.83CBDC046B@lists.fedorahosted.org> Date: Tue, 14 Oct 2008 04:28:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q4/txt/msg00033.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ea8e447f55864271a645a0b5ab32fb383bb8ad96 Commit: ea8e447f55864271a645a0b5ab32fb383bb8ad96 Parent: 33ac113b87bc000cb801de2a9f6f2bfe2f20cf22 Author: Abhijith Das AuthorDate: Mon Oct 13 23:24:47 2008 -0500 Committer: Abhijith Das 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);