nfsd: require an explicit option to enable pNFS
Subsystems (2)
PATCH 1/1 nfsd: require an explicit option to enable pNFS
Turns out sending out layouts to any client is a bad idea if they can't get at the storage device, so require explicit admin action to enable pNFS.
--- fs/nfsd/nfs4layouts.c | 2 +- include/uapi/linux/nfsd/export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4layouts.c +1 -1
@@ -118,7 +118,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp) {struct super_block *sb = exp->ex_path.mnt->mnt_sb; -if (exp->ex_flags &NFSEXP_NOPNFS ) +if (!(exp->ex_flags &NFSEXP_PNFS ))return ; if (sb->s_export_op->get_uuid &&
include/uapi/linux/nfsd/export.h +1 -1
@@ -47,7 +47,7 @@* exported filesystem. */ #define NFSEXP_V4ROOT 0x10000 -#define NFSEXP_NOPNFS 0x20000 +#define NFSEXP_PNFS 0x20000/* All flags that we claim to support. (Note we don't support NOACL.) */ #define NFSEXP_ALLFLAGS 0x3FE7F
Signature · 1 line
1.9.1
Quoted 3 lines · Christoph Hellwig
Turns out sending out layouts to any client is a bad idea if they can't get at the storage device, so require explicit admin action to enable pNFS.
Thanks, I'll pass along this and the accumulated fixes for 4.0 soon.
--b.
Quoted 35 lines
Signed-off-by Christoph Hellwig <[email protected]>--- fs/nfsd/nfs4layouts.c | 2 +- include/uapi/linux/nfsd/export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/nfsd/nfs4layouts.c +1
-1@@ -118,7 +118,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp) {struct super_block *sb = exp->ex_path.mnt->mnt_sb; -if (exp->ex_flags &NFSEXP_NOPNFS ) +if (!(exp->ex_flags &NFSEXP_PNFS ))return ; if (sb->s_export_op->get_uuid &&include/uapi/linux/nfsd/export.h +1
-1@@ -47,7 +47,7 @@* exported filesystem. */ #define NFSEXP_V4ROOT 0x10000 -#define NFSEXP_NOPNFS 0x20000 +#define NFSEXP_PNFS 0x20000/* All flags that we claim to support. (Note we don't support NOACL.) */ #define NFSEXP_ALLFLAGS 0x3FE7FSignature · 1 line
1.9.1
Quoted 28 lines · On Mon, 30 Mar 2015 18:46:29 +0200 Christoph Hellwig <[email protected]> wrote:
Turns out sending out layouts to any client is a bad idea if they can't get at the storage device, so require explicit admin action to enable pNFS.
Signed-off-by Christoph Hellwig <[email protected]>--- fs/nfsd/nfs4layouts.c | 2 +- include/uapi/linux/nfsd/export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/nfsd/nfs4layouts.c +1
-1@@ -118,7 +118,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp) {struct super_block *sb = exp->ex_path.mnt->mnt_sb; -if (exp->ex_flags &NFSEXP_NOPNFS ) +if (!(exp->ex_flags &NFSEXP_PNFS ))return ; if (sb->s_export_op->get_uuid &&include/uapi/linux/nfsd/export.h +0
-0
include/uapi/linux/nfsd/export.h line 53
Quoted 8 lines
include/uapi/linux/nfsd/export.h +1
-1@@ -47,7 +47,7 @@* exported filesystem. */ #define NFSEXP_V4ROOT 0x10000 -#define NFSEXP_NOPNFS 0x20000 +#define NFSEXP_PNFS 0x20000/* All flags that we claim to support. (Note we don't support NOACL.) */ #define NFSEXP_ALLFLAGS 0x3FE7F
Don't you also need to update the expflags array in fs/nfsd/export.c? You won't see this flag reported in nfsd.export otherwise. Not sure how big a problem that is however...
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 37 lines · Jeff Layton
Quoted 34 lines · On Mon, 30 Mar 2015 18:46:29 +0200 Christoph Hellwig <[email protected]> wrote:
Turns out sending out layouts to any client is a bad idea if they can't get at the storage device, so require explicit admin action to enable pNFS.
Signed-off-by Christoph Hellwig <[email protected]>--- fs/nfsd/nfs4layouts.c | 2 +- include/uapi/linux/nfsd/export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/nfsd/nfs4layouts.c +1
-1@@ -118,7 +118,7 @@ void nfsd4_setup_layout_type(struct svc_export *exp) {struct super_block *sb = exp->ex_path.mnt->mnt_sb; -if (exp->ex_flags &NFSEXP_NOPNFS ) +if (!(exp->ex_flags &NFSEXP_PNFS ))return ; if (sb->s_export_op->get_uuid &&include/uapi/linux/nfsd/export.h +1
-1@@ -47,7 +47,7 @@* exported filesystem. */ #define NFSEXP_V4ROOT 0x10000 -#define NFSEXP_NOPNFS 0x20000 +#define NFSEXP_PNFS 0x20000
Quoted 6 lines
include/uapi/linux/nfsd/export.h line 53
Quoted 2 lines
include/uapi/linux/nfsd/export.h +0
-0/* All flags that we claim to support. (Note we don't support NOACL.) */ #define NFSEXP_ALLFLAGS 0x3FE7FDon't you also need to update the expflags array in
fs/nfsd/export.c? You won't see this flag reported in nfsd.export otherwise. Not sure how big a problem that is however...
Yeah, that should be fixed, but in a followup patch, I'm passing this along now.
--b.