diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-08 20:39:29 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-08 20:39:29 -0500 |
| commit | ba00410b8131b23edfb0e09f8b6dd26c8eb621fb (patch) | |
| tree | c08504e4d2fa51ac91cef544f336d0169806c49f /fs/nfs/blocklayout | |
| parent | 8ce74dd6057832618957fc2cbd38fa959c3a0a6c (diff) | |
| parent | aa583096d9767892983332e7c1a984bd17e3cd39 (diff) | |
Merge branch 'iov_iter' into for-next
Diffstat (limited to 'fs/nfs/blocklayout')
| -rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 2 | ||||
| -rw-r--r-- | fs/nfs/blocklayout/rpc_pipefs.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 5228f201d3d5..4f46f7a05289 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c | |||
| @@ -378,7 +378,7 @@ bl_write_pagelist(struct nfs_pgio_header *header, int sync) | |||
| 378 | loff_t offset = header->args.offset; | 378 | loff_t offset = header->args.offset; |
| 379 | size_t count = header->args.count; | 379 | size_t count = header->args.count; |
| 380 | struct page **pages = header->args.pages; | 380 | struct page **pages = header->args.pages; |
| 381 | int pg_index = pg_index = header->args.pgbase >> PAGE_CACHE_SHIFT; | 381 | int pg_index = header->args.pgbase >> PAGE_CACHE_SHIFT; |
| 382 | unsigned int pg_len; | 382 | unsigned int pg_len; |
| 383 | struct blk_plug plug; | 383 | struct blk_plug plug; |
| 384 | int i; | 384 | int i; |
diff --git a/fs/nfs/blocklayout/rpc_pipefs.c b/fs/nfs/blocklayout/rpc_pipefs.c index 2a15fa437880..dbe5839cdeba 100644 --- a/fs/nfs/blocklayout/rpc_pipefs.c +++ b/fs/nfs/blocklayout/rpc_pipefs.c | |||
| @@ -65,17 +65,18 @@ bl_resolve_deviceid(struct nfs_server *server, struct pnfs_block_volume *b, | |||
| 65 | 65 | ||
| 66 | dprintk("%s CREATING PIPEFS MESSAGE\n", __func__); | 66 | dprintk("%s CREATING PIPEFS MESSAGE\n", __func__); |
| 67 | 67 | ||
| 68 | mutex_lock(&nn->bl_mutex); | ||
| 68 | bl_pipe_msg.bl_wq = &nn->bl_wq; | 69 | bl_pipe_msg.bl_wq = &nn->bl_wq; |
| 69 | 70 | ||
| 70 | b->simple.len += 4; /* single volume */ | 71 | b->simple.len += 4; /* single volume */ |
| 71 | if (b->simple.len > PAGE_SIZE) | 72 | if (b->simple.len > PAGE_SIZE) |
| 72 | return -EIO; | 73 | goto out_unlock; |
| 73 | 74 | ||
| 74 | memset(msg, 0, sizeof(*msg)); | 75 | memset(msg, 0, sizeof(*msg)); |
| 75 | msg->len = sizeof(*bl_msg) + b->simple.len; | 76 | msg->len = sizeof(*bl_msg) + b->simple.len; |
| 76 | msg->data = kzalloc(msg->len, gfp_mask); | 77 | msg->data = kzalloc(msg->len, gfp_mask); |
| 77 | if (!msg->data) | 78 | if (!msg->data) |
| 78 | goto out; | 79 | goto out_free_data; |
| 79 | 80 | ||
| 80 | bl_msg = msg->data; | 81 | bl_msg = msg->data; |
| 81 | bl_msg->type = BL_DEVICE_MOUNT, | 82 | bl_msg->type = BL_DEVICE_MOUNT, |
| @@ -87,7 +88,7 @@ bl_resolve_deviceid(struct nfs_server *server, struct pnfs_block_volume *b, | |||
| 87 | rc = rpc_queue_upcall(nn->bl_device_pipe, msg); | 88 | rc = rpc_queue_upcall(nn->bl_device_pipe, msg); |
| 88 | if (rc < 0) { | 89 | if (rc < 0) { |
| 89 | remove_wait_queue(&nn->bl_wq, &wq); | 90 | remove_wait_queue(&nn->bl_wq, &wq); |
| 90 | goto out; | 91 | goto out_free_data; |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | set_current_state(TASK_UNINTERRUPTIBLE); | 94 | set_current_state(TASK_UNINTERRUPTIBLE); |
| @@ -97,12 +98,14 @@ bl_resolve_deviceid(struct nfs_server *server, struct pnfs_block_volume *b, | |||
| 97 | if (reply->status != BL_DEVICE_REQUEST_PROC) { | 98 | if (reply->status != BL_DEVICE_REQUEST_PROC) { |
| 98 | printk(KERN_WARNING "%s failed to decode device: %d\n", | 99 | printk(KERN_WARNING "%s failed to decode device: %d\n", |
| 99 | __func__, reply->status); | 100 | __func__, reply->status); |
| 100 | goto out; | 101 | goto out_free_data; |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 103 | dev = MKDEV(reply->major, reply->minor); | 104 | dev = MKDEV(reply->major, reply->minor); |
| 104 | out: | 105 | out_free_data: |
| 105 | kfree(msg->data); | 106 | kfree(msg->data); |
| 107 | out_unlock: | ||
| 108 | mutex_unlock(&nn->bl_mutex); | ||
| 106 | return dev; | 109 | return dev; |
| 107 | } | 110 | } |
| 108 | 111 | ||
| @@ -232,6 +235,7 @@ static int nfs4blocklayout_net_init(struct net *net) | |||
| 232 | struct nfs_net *nn = net_generic(net, nfs_net_id); | 235 | struct nfs_net *nn = net_generic(net, nfs_net_id); |
| 233 | struct dentry *dentry; | 236 | struct dentry *dentry; |
| 234 | 237 | ||
| 238 | mutex_init(&nn->bl_mutex); | ||
| 235 | init_waitqueue_head(&nn->bl_wq); | 239 | init_waitqueue_head(&nn->bl_wq); |
| 236 | nn->bl_device_pipe = rpc_mkpipe_data(&bl_upcall_ops, 0); | 240 | nn->bl_device_pipe = rpc_mkpipe_data(&bl_upcall_ops, 0); |
| 237 | if (IS_ERR(nn->bl_device_pipe)) | 241 | if (IS_ERR(nn->bl_device_pipe)) |
