NOTE: this original bug description is incorrect - see my comment below for the actual description :)
Hi Rohan,
I've found a potential crash consistency issue in WineFS that occurs if the system crashes while truncating a file. Here are steps to reproduce it:
- Simulate a crash in WineFS by adding two return statements to inode.c in the following locations. This will force the system call to exit early, simulating a crash at that point.
- after the call to
PERSISTENT_BARRIER() on line 2079
- immediately after the call to
pmfs_truncate_add() on line 2192
- Mount a fresh instance of WineFS at /mnt/pmem. I am running WineFS in strict mode; I have not checked if this behavior occurs in relaxed mode.
- Run a program that creates a new file in WineFS, writes 1 byte to it, writes 1024 bytes to it, then truncates it to a larger size (I'm doing 1494, which was chosen randomly by a fuzzer; I don't think the actual number matters). I have attached the program I am using: test3.zip
After running this program, I would expect the file to either have size 1024 or 1494, but running stat on the file says that it is 1025 bytes. I plan to look into the root cause of this issue soon and will add more info once I have an idea of what might be causing this.
Thanks!
NOTE: this original bug description is incorrect - see my comment below for the actual description :)
Hi Rohan,
I've found a potential crash consistency issue in WineFS that occurs if the system crashes while truncating a file. Here are steps to reproduce it:
PERSISTENT_BARRIER()on line 2079pmfs_truncate_add()on line 2192After running this program, I would expect the file to either have size 1024 or 1494, but running
staton the file says that it is 1025 bytes. I plan to look into the root cause of this issue soon and will add more info once I have an idea of what might be causing this.Thanks!