aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 66411463b734..50e8c8582faa 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1340,10 +1340,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1340 /* 1340 /*
1341 * hooks: /n/, see "layering violations". 1341 * hooks: /n/, see "layering violations".
1342 */ 1342 */
1343 ret = devcgroup_inode_permission(bdev->bd_inode, perm); 1343 if (!for_part) {
1344 if (ret != 0) { 1344 ret = devcgroup_inode_permission(bdev->bd_inode, perm);
1345 bdput(bdev); 1345 if (ret != 0) {
1346 return ret; 1346 bdput(bdev);
1347 return ret;
1348 }
1347 } 1349 }
1348 1350
1349 restart: 1351 restart: