Skip to contentSkip to conversation

nfsd: require an explicit option to enable pNFS

PATCH In review Christoph Hellwig 3 participants 4 messages Mar 30, 2015 – Mar 31, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index f4e8da2..9a8254b 100644
@@ -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
index 4742f2c..d3bd6ffe 100644
@@ -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
#1 lore raw
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
---
 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
index f4e8da2..9a8254b 100644
@@ -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
index 4742f2c..d3bd6ffe 100644
@@ -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
#2 lore raw
In reply to Christoph Hellwig
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.

---
 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
index f4e8da2..9a8254b 100644
@@ -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
index 4742f2c..d3bd6ffe 100644

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]>
#3 lore raw
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.

---
 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
index f4e8da2..9a8254b 100644
@@ -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
index 4742f2c..d3bd6ffe 100644
@@ -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		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...

Yeah, that should be fixed, but in a followup patch, I'm passing this along now.

--b.