NFS41: fix error of setting blocklayoutdriver
authorPeng Tao <bergwolf@gmail.com>
Thu, 23 Aug 2012 16:27:49 +0000 (00:27 +0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 1 Oct 2012 22:37:39 +0000 (15:37 -0700)
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.

Cc: stable <stable@vger.kernel.org> [since v3.5]
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c
fs/nfs/nfs4proc.c

index 57d2a5c3d93303a4bc4ed12977c44e64cacd11f1..bab3e8af574a33cd19aff71ad7d17756d5b4f66d 100644 (file)
@@ -849,7 +849,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 9aa97112426fdcc9d4c202f39089ec12eb93ae48..e10d66f5be0ad0dd5c83d627daaf745fc221eb42 100644 (file)
@@ -3402,8 +3402,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;
 }