[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[017/152] NFS: Fix panic after nfs_umount()
    2.6.36-stable review patch.  If anyone has any objections, please let us know.


    From: Chuck Lever <>

    commit 5b362ac3799ff4225c40935500f520cad4d7ed66 upstream.

    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.


    Reported-by: Stefan Bader <>
    Tested-by: Stefan Bader <>
    Signed-off-by: Chuck Lever <>
    Signed-off-by: Trond Myklebust <>
    Signed-off-by: Greg Kroah-Hartman <>

    fs/nfs/mount_clnt.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/nfs/mount_clnt.c
    +++ b/fs/nfs/mount_clnt.c
    @@ -503,13 +503,13 @@ static struct rpc_procinfo mnt3_procedur

    static struct rpc_version mnt_version1 = {
    .number = 1,
    - .nrprocs = 2,
    + .nrprocs = ARRAY_SIZE(mnt_procedures),
    .procs = mnt_procedures,

    static struct rpc_version mnt_version3 = {
    .number = 3,
    - .nrprocs = 2,
    + .nrprocs = ARRAY_SIZE(mnt3_procedures),
    .procs = mnt3_procedures,

     \ /
      Last update: 2011-01-06 02:03    [W:0.020 / U:1.960 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site