Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-12-23 09:42:01 +1100
committerNeilBrown <neilb@suse.com>2018-04-27 13:10:56 +1000
commit13b6c643ab3ebb3cf72fc1b1c8aa4e2bfa9a7464 (patch)
tree7126e67a745b7c06c4bef3008c7404cda33273b2
parentdc01ba1bfceb7e38d72bd964ff2d9bc3e62539f3 (diff)
NFS: add nostatflush mount option (bsc#1065726).rpm-3.0.101-108.41
-rw-r--r--fs/nfs/inode.c3
-rw-r--r--fs/nfs/super.c10
-rw-r--r--include/linux/nfs_mount.h1
3 files changed, 13 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1639292fcf4c..013be4596e29 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -518,7 +518,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
int err;
/* Flush out writes to the server in order to update c/mtime. */
- if (S_ISREG(inode->i_mode)) {
+ if (S_ISREG(inode->i_mode) &&
+ !(NFS_SERVER(inode)->flags & NFS_MOUNT_NOSTATFLUSH)) {
err = filemap_write_and_wait(inode->i_mapping);
if (err)
goto out;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index c60663204f39..ec9d949a7d68 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -88,6 +88,7 @@ enum {
Opt_sharetransport, Opt_nosharetransport,
Opt_resvport, Opt_noresvport,
Opt_fscache, Opt_nofscache,
+ Opt_statflush, Opt_nostatflush,
/* Mount options that take integer arguments */
Opt_port,
@@ -152,6 +153,8 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_noresvport, "noresvport" },
{ Opt_fscache, "fsc" },
{ Opt_nofscache, "nofsc" },
+ { Opt_statflush, "statflush" },
+ { Opt_nostatflush, "nostatflush" },
{ Opt_port, "port=%s" },
{ Opt_rsize, "rsize=%s" },
@@ -647,6 +650,7 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
{ NFS_MOUNT_UNSHARED, ",nosharecache", "" },
{ NFS_MOUNT_NOSHARE_XPRT, ",nosharetransport", ""},
{ NFS_MOUNT_NORESVPORT, ",noresvport", "" },
+ { NFS_MOUNT_NOSTATFLUSH, ",nostatflush", "" },
{ 0, NULL, NULL }
};
const struct proc_nfs_info *nfs_infop;
@@ -1321,6 +1325,12 @@ static int nfs_parse_mount_options(char *raw,
goto out_invalid_value;
mnt->minorversion = option;
break;
+ case Opt_statflush:
+ mnt->flags &= ~NFS_MOUNT_NOSTATFLUSH;
+ break;
+ case Opt_nostatflush:
+ mnt->flags |= NFS_MOUNT_NOSTATFLUSH;
+ break;
/*
* options that take text values
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 81c49ffaa9f6..d70e420f20fd 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -74,5 +74,6 @@ struct nfs_mount_data {
#define NFS_MOUNT_LOCAL_FLOCK 0x100000
#define NFS_MOUNT_LOCAL_FCNTL 0x200000
#define NFS_MOUNT_NOSHARE_XPRT 0x400000
+#define NFS_MOUNT_NOSTATFLUSH 0x800000
#endif