aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout/blocklayoutdev.c
diff options
context:
space:
mode:
authorJim Rees <rees@umich.edu>2011-09-22 21:50:08 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-10-18 12:08:11 -0400
commit516f2e24faa7548a61d9ba790958528469c2e284 (patch)
treed4aa8a2fe75ada9a1af5257be8d14cb3b13fef65 /fs/nfs/blocklayout/blocklayoutdev.c
parent2da956523526e440ef4f4dd174e26f5ac06fe011 (diff)
pnfsblock: fix return code confusion
Always return PTR_ERR, not NULL, from nfs4_blk_get_deviceinfo and nfs4_blk_decode_device. Check for IS_ERR, not NULL, in bl_set_layoutdriver when calling nfs4_blk_get_deviceinfo. Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Benny Halevy <bhalevy@tonian.com> Cc: stable@kernel.org [3.0] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayoutdev.c')
-rw-r--r--fs/nfs/blocklayout/blocklayoutdev.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/nfs/blocklayout/blocklayoutdev.c b/fs/nfs/blocklayout/blocklayoutdev.c
index a83b393fb01c..0b1fb0e25b93 100644
--- a/fs/nfs/blocklayout/blocklayoutdev.c
+++ b/fs/nfs/blocklayout/blocklayoutdev.c
@@ -131,7 +131,7 @@ struct pnfs_block_dev *
131nfs4_blk_decode_device(struct nfs_server *server, 131nfs4_blk_decode_device(struct nfs_server *server,
132 struct pnfs_device *dev) 132 struct pnfs_device *dev)
133{ 133{
134 struct pnfs_block_dev *rv = NULL; 134 struct pnfs_block_dev *rv;
135 struct block_device *bd = NULL; 135 struct block_device *bd = NULL;
136 struct rpc_pipe_msg msg; 136 struct rpc_pipe_msg msg;
137 struct bl_msg_hdr bl_msg = { 137 struct bl_msg_hdr bl_msg = {
@@ -141,7 +141,7 @@ nfs4_blk_decode_device(struct nfs_server *server,
141 uint8_t *dataptr; 141 uint8_t *dataptr;
142 DECLARE_WAITQUEUE(wq, current); 142 DECLARE_WAITQUEUE(wq, current);
143 struct bl_dev_msg *reply = &bl_mount_reply; 143 struct bl_dev_msg *reply = &bl_mount_reply;
144 int offset, len, i; 144 int offset, len, i, rc;
145 145
146 dprintk("%s CREATING PIPEFS MESSAGE\n", __func__); 146 dprintk("%s CREATING PIPEFS MESSAGE\n", __func__);
147 dprintk("%s: deviceid: %s, mincount: %d\n", __func__, dev->dev_id.data, 147 dprintk("%s: deviceid: %s, mincount: %d\n", __func__, dev->dev_id.data,
@@ -168,8 +168,10 @@ nfs4_blk_decode_device(struct nfs_server *server,
168 168
169 dprintk("%s CALLING USERSPACE DAEMON\n", __func__); 169 dprintk("%s CALLING USERSPACE DAEMON\n", __func__);
170 add_wait_queue(&bl_wq, &wq); 170 add_wait_queue(&bl_wq, &wq);
171 if (rpc_queue_upcall(bl_device_pipe->d_inode, &msg) < 0) { 171 rc = rpc_queue_upcall(bl_device_pipe->d_inode, &msg);
172 if (rc < 0) {
172 remove_wait_queue(&bl_wq, &wq); 173 remove_wait_queue(&bl_wq, &wq);
174 rv = ERR_PTR(rc);
173 goto out; 175 goto out;
174 } 176 }
175 177
@@ -187,8 +189,9 @@ nfs4_blk_decode_device(struct nfs_server *server,
187 189
188 bd = nfs4_blkdev_get(MKDEV(reply->major, reply->minor)); 190 bd = nfs4_blkdev_get(MKDEV(reply->major, reply->minor));
189 if (IS_ERR(bd)) { 191 if (IS_ERR(bd)) {
190 dprintk("%s failed to open device : %ld\n", 192 rc = PTR_ERR(bd);
191 __func__, PTR_ERR(bd)); 193 dprintk("%s failed to open device : %d\n", __func__, rc);
194 rv = ERR_PTR(rc);
192 goto out; 195 goto out;
193 } 196 }
194 197