Skip to contentSkip to conversation

nfsd: clear NFSEXP_PNFS flags if not supports pnfs in kernel

PATCH In review Kinglong Mee 3 participants 3 messages Apr 5, 2015 – Apr 6, 2015

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

PATCH 1/1 nfsd: clear NFSEXP_PNFS flags if not supports pnfs in kernel

nfsd should not show "pnfs" flag in proc file if the filesystem does not support pnfs.

# cat /proc/fs/nfsd/exports
# Version 1.1
# Path Client(Flags) # IPs
/testfs    *(rw,insecure,no_root_squash,sync,wdelay,no_subtree_check,pnfs,fsid=0,uuid=37b07525:dc5e4203:99cc71b0:3df9dfa5,sec=1)
---
 fs/nfsd/nfs4layouts.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfsd/nfs4layouts.c +2 -0
index 6904213..f4c9bf3 100644
@@ -125,6 +125,8 @@ void nfsd4_setup_layout_type(struct svc_export *exp)
 	    sb->s_export_op->map_blocks &&
 	    sb->s_export_op->commit_blocks)
 		exp->ex_layout_type = LAYOUT_BLOCK_VOLUME;
+	else
+		exp->ex_flags &= ~NFSEXP_PNFS;
 }
 
 static void
Signature · 1 line
2.3.4
#1 lore raw
Quoted 2 lines · Kinglong Mee

nfsd should not show "pnfs" flag in proc file if the filesystem does not support pnfs.

Hmm, do we want to silently clear or reject it? Either way the !CONFIG_NFSD_PNFS stub needs to do the same.

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Kinglong Mee

nfsd should not show "pnfs" flag in proc file if the filesystem does not support pnfs.

Hmm, do we want to silently clear or reject it? Either way the !CONFIG_NFSD_PNFS stub needs to do the same.

There's a note:

	/* quietly ignore unknown words and anything
	 * following. Newer user-space can try to set
	 * new values, then see what the result was.
	 */

Not sure if that's the best approach, but I guess we should stick with it.

--b.