From 8e54a35e155f5febc6ca1cfd47028a9622c07aee Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 5 Nov 2008 14:54:41 +0100 Subject: [PATCH] --- yaml --- r: 119724 b: refs/heads/master c: ebbefc011e56bd85b4745d01e5b8d7d05d95ed5d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/block_dev.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 3e718d1f6412..66ac56e63cc3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1c925604e1038c7c65b91a92d14dc972b3a70a97 +refs/heads/master: ebbefc011e56bd85b4745d01e5b8d7d05d95ed5d diff --git a/trunk/fs/block_dev.c b/trunk/fs/block_dev.c index db831efbdbbd..7c727523bc54 100644 --- a/trunk/fs/block_dev.c +++ b/trunk/fs/block_dev.c @@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp) if (res) return res; - if (!(filp->f_mode & FMODE_EXCL)) - return 0; + if (filp->f_mode & FMODE_EXCL) { + res = bd_claim(bdev, filp); + if (res) + goto out_blkdev_put; + } - if (!(res = bd_claim(bdev, filp))) - return 0; + return 0; + out_blkdev_put: blkdev_put(bdev, filp->f_mode); return res; }