]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFS41: fix error of setting blocklayoutdriver
authorPeng Tao <bergwolf@gmail.com>
Thu, 23 Aug 2012 16:27:49 +0000 (00:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Oct 2012 16:32:38 +0000 (09:32 -0700)
commit dc182549d439f60c332bf74d7f220a1bccf37da6 upstream.

After commit e38eb650 (NFS: set_pnfs_layoutdriver() from
nfs4_proc_fsinfo()), set_pnfs_layoutdriver() is called inside
nfs4_proc_fsinfo(), but pnfs_blksize is not set. It causes setting
blocklayoutdriver failure and pnfsblock mount failure.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/client.c
fs/nfs/nfs4proc.c

index 99694442b93f6d64f5f433d8cf3cc8fdc08de52e..0e7cd89562b2139a625ee22e5ded77c8f1dbba69 100644 (file)
@@ -855,7 +855,6 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
        if (server->wsize > NFS_MAX_FILE_IO_SIZE)
                server->wsize = NFS_MAX_FILE_IO_SIZE;
        server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-       server->pnfs_blksize = fsinfo->blksize;
 
        server->wtmult = nfs_block_bits(fsinfo->wtmult, NULL);
 
index 1e50326d00ddd1f7ef8931470bc1cd0ad32b4015..1f0c4bf4de573e68af045523908fcb8e53d0ba6a 100644 (file)
@@ -3362,8 +3362,11 @@ static int nfs4_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, s
 
        nfs_fattr_init(fsinfo->fattr);
        error = nfs4_do_fsinfo(server, fhandle, fsinfo);
-       if (error == 0)
+       if (error == 0) {
+               /* block layout checks this! */
+               server->pnfs_blksize = fsinfo->blksize;
                set_pnfs_layoutdriver(server, fhandle, fsinfo->layouttype);
+       }
 
        return error;
 }