[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.10 2/9] block: do not set BDS read_only if
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH for-2.10 2/9] block: do not set BDS read_only if copy_on_read enabled |
Date: |
Fri, 7 Apr 2017 10:45:25 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, Apr 05, 2017 at 02:28:44PM -0400, Jeff Cody wrote:
> @@ -1173,7 +1171,18 @@ static int vvfat_open(BlockDriverState *bs, QDict
> *options, int flags,
> if (ret < 0) {
> goto fail;
> }
> - bdrv_set_read_only(bs, false);
> + ret = bdrv_set_read_only(bs, false, &local_err);
> + if (ret < 0) {
> + error_propagate(errp, local_err);
> + goto fail;
> + }
I realized later in the series why you are doing this.
The error code path introduces a resource leak: enable_write_target()
has already been called and isn't cleaned up by the fail label.
It would be cleaner to check that bs is writable before calling
enable_write_target().
Stefan
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [PATCH for-2.10 3/9] block: honor BDRV_O_ALLOW_RDWR when clearing bs->read_only, (continued)
[Qemu-devel] [PATCH for-2.10 4/9] block: code movement, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 2/9] block: do not set BDS read_only if copy_on_read enabled, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 5/9] block: introduce bdrv_try_set_read_only(), Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 6/9] block: use bdrv_try_set_read_only() during reopen, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 7/9] block/rbd - update variable names to more apt names, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 9/9] block/rbd: Add support for reopen(), Jeff Cody, 2017/04/05