提交 5b362ac3 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

NFS: Fix panic after nfs_umount()

After a few unsuccessful NFS mount attempts in which the client and
server cannot agree on an authentication flavor both support, the
client panics.  nfs_umount() is invoked in the kernel in this case.

Turns out nfs_umount()'s UMNT RPC invocation causes the RPC client to
write off the end of the rpc_clnt's iostat array.  This is because the
mount client's nrprocs field is initialized with the count of defined
procedures (two: MNT and UMNT), rather than the size of the client's
proc array (four).

The fix is to use the same initialization technique used by most other
upper layer clients in the kernel.

Introduced by commit 0b524123, which failed to update nrprocs when
support was added for UMNT in the kernel.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=24302
BugLink: http://bugs.launchpad.net/bugs/683938Reported-by: NStefan Bader <stefan.bader@canonical.com>
Tested-by: NStefan Bader <stefan.bader@canonical.com>
Cc: stable@kernel.org # >= 2.6.32
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 2df485a7
...@@ -505,13 +505,13 @@ static struct rpc_procinfo mnt3_procedures[] = { ...@@ -505,13 +505,13 @@ static struct rpc_procinfo mnt3_procedures[] = {
static struct rpc_version mnt_version1 = { static struct rpc_version mnt_version1 = {
.number = 1, .number = 1,
.nrprocs = 2, .nrprocs = ARRAY_SIZE(mnt_procedures),
.procs = mnt_procedures, .procs = mnt_procedures,
}; };
static struct rpc_version mnt_version3 = { static struct rpc_version mnt_version3 = {
.number = 3, .number = 3,
.nrprocs = 2, .nrprocs = ARRAY_SIZE(mnt3_procedures),
.procs = mnt3_procedures, .procs = mnt3_procedures,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册