summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_unix.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@poochiereds.net>2015-08-03 13:44:53 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-12 20:31:04 +0200
commit24a9a9610ce3ba36fd87c1d2f2c9106de6b7e832 (patch)
treeb2137eb31c216ad8a962b083c1108103bc380f59 /net/sunrpc/auth_unix.c
parentNFSv4.2/pnfs: Use GFP_NOIO for layoutstat reporting in the writeback path (diff)
downloadlinux-24a9a9610ce3ba36fd87c1d2f2c9106de6b7e832.tar.xz
linux-24a9a9610ce3ba36fd87c1d2f2c9106de6b7e832.zip
sunrpc: increase UNX_MAXNODENAME from 32 to __NEW_UTS_LEN bytes
The current limit of 32 bytes artificially limits the name string that we end up stuffing into NFSv4.x client ID blobs. If you have multiple hosts with long hostnames that only differ near the end, then this can cause NFSv4 client ID collisions. Linux nodenames are actually limited to __NEW_UTS_LEN bytes (64), so use that as the limit instead. Also, use XDR_QUADLEN to specify the slack length, just for clarity and in case someone in the future changes this to something not evenly divisible by 4. Reported-by: Michael Skralivetsky <michael.skralivetsky@primarydata.com> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc/auth_unix.c')
-rw-r--r--net/sunrpc/auth_unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index 4feda2d0a833..548240dd15fc 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -23,7 +23,7 @@ struct unx_cred {
};
#define uc_uid uc_base.cr_uid
-#define UNX_WRITESLACK (21 + (UNX_MAXNODENAME >> 2))
+#define UNX_WRITESLACK (21 + XDR_QUADLEN(UNX_MAXNODENAME))
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_AUTH