From: Jan Kara <jack@suse.cz>
To: Michal Suchanek <msuchanek@suse.de>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] bdev: reset first_open when looping in __blkget_dev
Date: Wed, 18 Dec 2019 13:27:41 +0100 [thread overview]
Message-ID: <20191218122741.GA19387@quack2.suse.cz> (raw)
In-Reply-To: <20191217180428.8868-1-msuchanek@suse.de>
On Tue 17-12-19 19:04:28, Michal Suchanek wrote:
> 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@suse.de>
Yeah, good catch. Thanks for the patch. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> 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 69bf2fb6f7cd..17e1231d5246 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
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2019-12-18 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 18:04 Michal Suchanek
2019-12-18 12:27 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191218122741.GA19387@quack2.suse.cz \
--to=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=msuchanek@suse.de \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®