summaryrefslogtreecommitdiff
path: root/fs/nfs/blocklayout
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-07-08 12:41:28 +0300
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-07-15 22:46:08 +0300
commit0173ca0544b682b7b313269dc0600d4774098a14 (patch)
treea27d8a7fe5ced11f29b09ac792df0fd2a8af5d2f /fs/nfs/blocklayout
parent5edb56491d4812c42175980759da53388e5d86f5 (diff)
downloadlinux-0173ca0544b682b7b313269dc0600d4774098a14.tar.xz
nfs/blocklayout: use proper fmode for opening block devices
This was fixed for the original block layout code a while ago, but also needs to be fixed for the SCSI layout path. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r--fs/nfs/blocklayout/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c
index e5b89675263e..7fb9c07c078c 100644
--- a/fs/nfs/blocklayout/dev.c
+++ b/fs/nfs/blocklayout/dev.c
@@ -316,7 +316,7 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
return -EINVAL;
}
- d->bdev = blkdev_get_by_path(devname, FMODE_READ, NULL);
+ d->bdev = blkdev_get_by_path(devname, FMODE_READ | FMODE_WRITE, NULL);
if (IS_ERR(d->bdev)) {
pr_warn("pNFS: failed to open device %s (%ld)\n",
devname, PTR_ERR(d->bdev));
@@ -352,7 +352,7 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
return 0;
out_blkdev_put:
- blkdev_put(d->bdev, FMODE_READ);
+ blkdev_put(d->bdev, FMODE_READ | FMODE_WRITE);
return error;
}