block: Move read-only check during truncation earlier
commit97efa8698e554769fc23e8120fe9c56ab45cddc5
authorEric Blake <eblake@redhat.com>
Wed, 9 Jun 2021 16:30:34 +0000 (9 11:30 -0500)
committerKevin Wolf <kwolf@redhat.com>
Tue, 29 Jun 2021 14:51:00 +0000 (29 16:51 +0200)
tree70e8dceaa51c84d1039ac5476d663624f2178791
parent2d369d6e6e890a0204183e853604f8077329c4bc
block: Move read-only check during truncation earlier

No need to start a tracked request that will always fail.  The choice
to check read-only after bdrv_inc_in_flight() predates 1bc5f09f2e
(block: Use tracked request for truncate), but waiting for serializing
requests can make the effect more noticeable.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210609163034.997943-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c