[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b241c0d380e42c114bd9ca7955260fdd708ef76c.1574797504.git.msuchanek@suse.de>
Date: Tue, 26 Nov 2019 20:54:25 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: linux-scsi@...r.kernel.org, linux-block@...r.kernel.org
Cc: Michal Suchanek <msuchanek@...e.de>,
Jonathan Corbet <corbet@....net>, Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Eric Biggers <ebiggers@...gle.com>,
"J. Bruce Fields" <bfields@...hat.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Benjamin Coddington <bcodding@...hat.com>,
Ming Lei <ming.lei@...hat.com>,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
Bart Van Assche <bvanassche@....org>,
Damien Le Moal <damien.lemoal@....com>,
Hou Tao <houtao1@...wei.com>,
Pavel Begunkov <asml.silence@...il.com>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Jan Kara <jack@...e.cz>, Hannes Reinecke <hare@...e.com>,
"Ewan D. Milne" <emilne@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
Matthew Wilcox <willy@...radead.org>
Subject: [PATCH v4 rebase 06/10] bdev: reset first_open when looping in __blkget_dev
It is not clear that no other thread cannot open the block device when
__blkget_dev drops it and loop to restart label. Reset first_open to
false when looping.
Signed-off-by: Michal Suchanek <msuchanek@...e.de>
---
fs/block_dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index ee63c2732fa2..545bb6c8848a 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1560,7 +1560,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
int ret;
int partno;
int perm = 0;
- bool first_open = false;
+ bool first_open;
if (mode & FMODE_READ)
perm |= MAY_READ;
@@ -1580,6 +1580,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
restart:
ret = -ENXIO;
+ first_open = false;
disk = bdev_get_gendisk(bdev, &partno);
if (!disk)
goto out;
--
2.23.0
Powered by blists - more mailing lists