1f2208fdcSAlberto Garcia#!/usr/bin/env bash 2f2208fdcSAlberto Garcia# 3f2208fdcSAlberto Garcia# Test write request with required alignment larger than the cluster size 4f2208fdcSAlberto Garcia# 5f2208fdcSAlberto Garcia# Copyright (C) 2019 Igalia, S.L. 6f2208fdcSAlberto Garcia# Author: Alberto Garcia <berto@igalia.com> 7f2208fdcSAlberto Garcia# 8f2208fdcSAlberto Garcia# This program is free software; you can redistribute it and/or modify 9f2208fdcSAlberto Garcia# it under the terms of the GNU General Public License as published by 10f2208fdcSAlberto Garcia# the Free Software Foundation; either version 2 of the License, or 11f2208fdcSAlberto Garcia# (at your option) any later version. 12f2208fdcSAlberto Garcia# 13f2208fdcSAlberto Garcia# This program is distributed in the hope that it will be useful, 14f2208fdcSAlberto Garcia# but WITHOUT ANY WARRANTY; without even the implied warranty of 15f2208fdcSAlberto Garcia# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16f2208fdcSAlberto Garcia# GNU General Public License for more details. 17f2208fdcSAlberto Garcia# 18f2208fdcSAlberto Garcia# You should have received a copy of the GNU General Public License 19f2208fdcSAlberto Garcia# along with this program. If not, see <http://www.gnu.org/licenses/>. 20f2208fdcSAlberto Garcia# 21f2208fdcSAlberto Garcia 22f2208fdcSAlberto Garcia# creator 23f2208fdcSAlberto Garciaowner=berto@igalia.com 24f2208fdcSAlberto Garcia 25f2208fdcSAlberto Garciaseq=`basename $0` 26f2208fdcSAlberto Garciaecho "QA output created by $seq" 27f2208fdcSAlberto Garcia 28f2208fdcSAlberto Garciastatus=1 # failure is the default! 29f2208fdcSAlberto Garcia 30f2208fdcSAlberto Garcia_cleanup() 31f2208fdcSAlberto Garcia{ 32f2208fdcSAlberto Garcia _cleanup_test_img 33f2208fdcSAlberto Garcia} 34f2208fdcSAlberto Garciatrap "_cleanup; exit \$status" 0 1 2 3 15 35f2208fdcSAlberto Garcia 36f2208fdcSAlberto Garcia# get standard environment, filters and checks 37f2208fdcSAlberto Garcia. ./common.rc 38f2208fdcSAlberto Garcia. ./common.filter 39f2208fdcSAlberto Garcia 40f2208fdcSAlberto Garcia_supported_fmt qcow2 41*57284d2aSMax Reitz_supported_proto file fuse 42f2208fdcSAlberto Garcia 43f2208fdcSAlberto Garciaecho 44f2208fdcSAlberto Garciaecho "== Required alignment larger than cluster size ==" 45f2208fdcSAlberto Garcia 46f2208fdcSAlberto GarciaCLUSTER_SIZE=2k _make_test_img 1M 47f2208fdcSAlberto Garcia# Since commit c8bb23cbdb writing to an unallocated cluster fills the 48f2208fdcSAlberto Garcia# empty COW areas with bdrv_write_zeroes(flags=BDRV_REQ_NO_FALLBACK) 49f2208fdcSAlberto Garcia$QEMU_IO -c "open -o driver=$IMGFMT,file.align=4k blkdebug::$TEST_IMG" \ 50f2208fdcSAlberto Garcia -c "write 0 512" | _filter_qemu_io 51f2208fdcSAlberto Garcia 52f2208fdcSAlberto Garcia# success, all done 53f2208fdcSAlberto Garciaecho "*** done" 54f2208fdcSAlberto Garciarm -f $seq.full 55f2208fdcSAlberto Garciastatus=0 56