• Martin Kaiser's avatar
    nfs: keep server info for remounts · b322bf9e
    Martin Kaiser authored
    With newer kernels that use fs_context for nfs mounts, remounts fail with
    -EINVAL.
    
    $ mount -t nfs -o nolock 10.0.0.1:/tmp/test /mnt/test/
    $ mount -t nfs -o remount /mnt/test/
    mount: mounting 10.0.0.1:/tmp/test on /mnt/test failed: Invalid argument
    
    For remounts, the nfs server address and port are populated by
    nfs_init_fs_context and later overwritten with 0x00 bytes by
    nfs23_parse_monolithic. The remount then fails as the server address is
    invalid.
    
    Fix this by not overwriting nfs server info in nfs23_parse_monolithic if
    we're doing a remount.
    
    Fixes: f2aedb71 ("NFS: Add fs_context support.")
    Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    b322bf9e
fs_context.c 41.7 KB