summaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout/blocklayout.c
diff options
context:
space:
mode:
authorChristoph Hellwig2014-08-21 18:09:26 +0200
committerTrond Myklebust2014-09-10 21:47:02 +0200
commite3aaf7f2b8e9e858c0d6626577d3456bf6070e5a (patch)
tree08ff28dbec68a9af3b0528340e642b9c8ded3b08 /fs/nfs/blocklayout/blocklayout.c
parentpnfs: allow splicing pre-encoded pages into the layoutcommit args (diff)
downloadkernel-qcow2-linux-e3aaf7f2b8e9e858c0d6626577d3456bf6070e5a.tar.gz
kernel-qcow2-linux-e3aaf7f2b8e9e858c0d6626577d3456bf6070e5a.tar.xz
kernel-qcow2-linux-e3aaf7f2b8e9e858c0d6626577d3456bf6070e5a.zip
pnfs/blocklayout: reject pnfs blocksize larger than page size
The Linux VM subsystem can't support block sizes larger than page size for block based filesystems very well. While this can be hacked around to some extent for simple filesystems the read-modify-write cycles required for pnfs block invalid extents are extremly deadlock prone when operating on multiple pages. Reject this case early on instead of pretending to support it (badly). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.c')
-rw-r--r--fs/nfs/blocklayout/blocklayout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index cbb1797149d5..6c1a4212919d 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -1115,6 +1115,12 @@ bl_set_layoutdriver(struct nfs_server *server, const struct nfs_fh *fh)
dprintk("%s Server did not return blksize\n", __func__);
return -EINVAL;
}
+ if (server->pnfs_blksize > PAGE_SIZE) {
+ printk(KERN_ERR "%s: pNFS blksize %d not supported.\n",
+ __func__, server->pnfs_blksize);
+ return -EINVAL;
+ }
+
b_mt_id = kzalloc(sizeof(struct block_mount_id), GFP_NOFS);
if (!b_mt_id) {
status = -ENOMEM;