On 9/16/14 8:41 PM, Dave Chinner wrote: > This test exposed a problem with mapped writes to the tail page of a > file in XFS and potentially ext4. Eric did all the hard work of > taking the bug report and generating the reproducable test case > on ext4, but I haven't been able to reproduce then problem on ext4. > > Regardless, make it a generic test so that we can ensure that all > filesystems handle the case correctly. Oof, kermit on #xfs points out that even this is sufficient to show a problem: mkfs.ext4 -b 1024 -F empty.img mount -o loop empty.img mnt sync xfs_io -f -t \ -c "pwrite 0 0x210 " \ -c "mmap -rw 0 0xd08 " \ -c "mwrite -S 0x50 0x210 0xaf8" \ -c "truncate 0x1000" \ mnt/testfile echo "==== Pre-Remount ===" hexdump -C mnt/testfile | tail -n 8 umount mnt/ mount -o loop empty.img mnt echo "==== Post-Remount ==" hexdump -C mnt/testfile | tail -n 8 i'm not sure about the testcase - mmapping beyond EOF? - but seeing data change after remount looks scary regardless. ==== Pre-Remount === 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000210 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 |PPPPPPPPPPPPPPPP| * 00000d00 50 50 50 50 50 50 50 50 00 00 00 00 00 00 00 00 |PPPPPPPP........| 00000d10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00001000 ==== Post-Remount == 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000210 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 |PPPPPPPPPPPPPPPP| * 00000400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00001000 -Eric -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html