utsaslab / WineFS

WineFS (SOSP 21): a huge-page aware file system for persistent memory
34 stars 2 forks source link

Potential crash consistency bug in unlink #22

Open paulwedeck opened 11 months ago

paulwedeck commented 11 months ago

Hello, I discovered a similar bug to #20 but in the unlink operation. If unlink fails after the inode has been written to the truncate list, the truncate list recovery code will "truncate" the file to its former size. During this operation, it updates the file timestamp.

I think this is invalid because this is neither the original nor the intended final state. My fix works by only truncating the file if the new size is different from the old size.