2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2021, Jeff Layton <jlayton@redhat.com>
7 # Open a file and write a little data to it. Unmount (to clean out the cache)
8 # and then mount again. Then write some data to it beyond the EOF and ensure
9 # the result is correct.
11 # Prompted by a bug in ceph_write_begin that was fixed by commit 827a746f405d.
14 _begin_fstest auto quick rw
16 # Import common functions.
19 # real QA test starts here
23 testfile="$TEST_DIR/test_write_begin.$$"
25 # write some data to file and fsync it out
26 $XFS_IO_PROG -f -c "pwrite -q 0 32" $testfile
28 # cycle the mount to clean out the pagecache
31 # now, write to the file (near the end)
32 $XFS_IO_PROG -c "pwrite -q 32 32" $testfile
34 # dump what we think is in there
35 echo "The result should be 64 bytes filled with 0xcd:"