Skip to contentSkip to conversation

NFS: Don't print a pNFS error if we aren't using pNFS

PATCH In review [email protected] 2 participants 2 messages Nov 4, 2016

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

PATCH 1/1 NFS: Don't print a pNFS error if we aren't using pNFS

From: Anna Schumaker <[email protected]>

We used to check for a valid layout type id before verifying pNFS flags as an indicator for if we are using pNFS. This changed in 3132e49ece with the introduction of multiple layout types, since now we are passing an array of ids instead of just one. Since then, users have been seeing a KERN_ERR printk show up whenever mounting NFS v4 without pNFS. This patch restores the original behavior of exiting set_pnfs_layoutdriver() early if we aren't using pNFS.

Fixes 3132e49ece ("pnfs: track multiple layout types in fsinfo structure")

---
 fs/nfs/pnfs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfs/pnfs.c +2 -0
index 56b2d96..259ef85 100644
@@ -146,6 +146,8 @@ set_pnfs_layoutdriver(struct nfs_server *server, const struct nfs_fh *mntfh,
 	u32 id;
 	int i;
 
+	if (fsinfo->nlayouttypes == 0)
+		goto out_no_driver;
 	if (!(server->nfs_client->cl_exchange_flags &
 		 (EXCHGID4_FLAG_USE_NON_PNFS | EXCHGID4_FLAG_USE_PNFS_MDS))) {
 		printk(KERN_ERR "NFS: %s: cl_exchange_flags 0x%x\n",
Signature · 1 line
2.10.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · On Fri, 2016-11-04 at 09:08 -0400, [email protected] wrote:

From: Anna Schumaker <[email protected]>

We used to check for a valid layout type id before verifying pNFS flags as an indicator for if we are using pNFS. This changed in 3132e49ece with the introduction of multiple layout types, since now we are passing an array of ids instead of just one. Since then, users have been seeing a KERN_ERR printk show up whenever mounting NFS v4 without pNFS. This patch restores the original behavior of exiting set_pnfs_layoutdriver() early if we aren't using pNFS.

Fixes 3132e49ece ("pnfs: track multiple layout types in fsinfo structure")

---
 fs/nfs/pnfs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfs/pnfs.c +0 -0
index 56b2d96..259ef85 100644

fs/nfs/pnfs.c set_pnfs_layoutdriver(struct nfs_server *server, const struct nfs_fh *mntfh, · line 153

Quoted 8 lines
fs/nfs/pnfs.c +2 -0
@@ -146,6 +146,8 @@ set_pnfs_layoutdriver(struct nfs_server *server, const struct nfs_fh *mntfh,
 	u32 id;
 	int i;
 
+	if (fsinfo->nlayouttypes == 0)
+		goto out_no_driver;
 	if (!(server->nfs_client->cl_exchange_flags &
 		 (EXCHGID4_FLAG_USE_NON_PNFS | EXCHGID4_FLAG_USE_PNFS_MDS))) {
 		printk(KERN_ERR "NFS: %s: cl_exchange_flags 0x%x\n",

Good catch!