This adds assertions that ensure that the necessary write permissions
have been granted before someone attempts to write to a node.
Signed-off-by: Kevin Wolf <[email protected]>
Acked-by: Fam Zheng <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
size_t skip_bytes;
int ret;
+ assert(child->perm & (BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE));
+
/* Cover entire cluster so no additional backing file I/O is required when
* allocating cluster in the image file.
*/
assert(!waited || !req->serialising);
assert(req->overlap_offset <= offset);
assert(offset + bytes <= req->overlap_offset + req->overlap_bytes);
+ assert(child->perm & BLK_PERM_WRITE);
ret = notifier_with_return_list_notify(&bs->before_write_notifiers, req);