Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 2572

kernel-2.6.18-194.11.1.el5.src.rpm

From: Steve Dickson <SteveD@redhat.com>
Date: Thu, 28 Aug 2008 16:19:34 -0400
Subject: [nfs] disable the fsc mount option
Message-id: 48B70856.80406@RedHat.com
O-Subject: [RHEL5.3 PATCH] NFS: Disable the fsc mount option
Bugzilla: 447474
RH-Acked-by: Jeff Layton <jlayton@redhat.com>
RH-Acked-by: Jeff Moyer <jmoyer@redhat.com>

As of RHEL 5.3, FS-Cache feature will no longer be available in a RHEL kernel.
This patch disables this feature by stopping NFS from registering with the
caching system and turning off the mount option in the early stages of
a mount.

The 'fsc' mount option has also been removed from the 5.3 version of
the nfs-utils rpm.

The bz is:
https://bugzilla.redhat.com/show_bug.cgi?id=447474

steved.

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index a7e914d..9584028 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -939,6 +939,9 @@ static int nfs4_init_server(struct nfs_server *server,
 
 	/* Initialise the client representation from the mount data */
 	server->flags = data->flags & NFS_MOUNT_FLAGMASK;
+	/* Make sure FSC stays off */
+	server->flags &= ~NFS4_MOUNT_FSCACHE;
+
 	server->caps |= NFS_CAP_ATOMIC_OPEN;
 
 	if (data->rsize)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index e4cabd1..0382272 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1150,10 +1150,6 @@ static int __init init_nfs_fs(void)
 {
 	int err;
 
-	err = nfs_fscache_register();
-	if (err < 0)
-		goto out6;
-
 	err = nfs_fs_proc_init();
 	if (err)
 		goto out5;
@@ -1200,8 +1196,6 @@ out3:
 out4:
 	nfs_fs_proc_exit();
 out5:
-	nfs_fscache_unregister();
-out6:
 	return err;
 }
 
@@ -1212,7 +1206,6 @@ static void __exit exit_nfs_fs(void)
 	nfs_destroy_readpagecache();
 	nfs_destroy_inodecache();
 	nfs_destroy_nfspagecache();
-	nfs_fscache_unregister();
 #ifdef CONFIG_PROC_FS
 	rpc_proc_unregister("nfs");
 #endif
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index c01d360..82d4ad1 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -547,6 +547,9 @@ static int nfs_validate_mount_data(struct nfs_mount_data *data,
 		memset(mntfh->data + mntfh->size, 0,
 		       sizeof(mntfh->data) - mntfh->size);
 
+	/* Make sure FSC stays off */
+	data->flags &= ~NFS_MOUNT_FSCACHE;
+
 	return 0;
 }