On Thu, Mar 7, 2019 at 10:35 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote: > > On Thu, Mar 07, 2019 at 05:19:51PM -0600, Jayashree Mohan wrote: > > Hi Amir, > > > > > I went back to look at similar fsync tests by Filipe: > > > generic/{106,107,335,336,341,342,343,348,498,501,502,509,510,512} > > > > > > I found some alleged subtle mistakes about SOMC assumptions. > > > > > > generic/336 does: > > > touch $SCRATCH_MNT/a/foo > > > ln $SCRATCH_MNT/a/foo $SCRATCH_MNT/b/foo_link > > > touch $SCRATCH_MNT/b/bar > > > sync > > > unlink $SCRATCH_MNT/b/foo_link > > > mv $SCRATCH_MNT/b/bar $SCRATCH_MNT/c/ > > > $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/a/foo > > > > This is probably what's happening in this particular test : > > > > SOMC requires: > > fsync(a/foo) must ensure unlink(b/foo_link) (because they > > were linked at some point) > > > > But what happens is: > > fsync(a/foo) --> unlink(b/foo_link) > > unlink(b/foo_link) --> fsync(b) > > fsync(b) --> rename goes through > > > > SOMC should only require that the unlink persists. > > That's a /fsync/ requirement, not SOMC. > > SOMC says: > > "If the rename after the fsync()d unlink is present after recovery, > then every metadata operation completed between the unlink and the > rename must also be present after recovery." Isn't this a bit too broad? That sounds more like total ordering of metadata operations rather than SOMC. Shouldn't SOMC say "all operations dependent upon the rename should be present after recovery if rename is present?"