The block lock functions were trying to compare the block header seq and
the super seq to decide if the block is stable and if it should lock, or
not. Readers trying to lock races with transaction commits.
Transaction commit can update the super after the reader locks and
before it unlocks. The unlock will then fail the test and fail to
unlock. fsstress triggered this in xfstests generic/013.
Instead we can always acquire the read lock on stable blocks. We'll be
bouncing the rwsem cacheline around like the refcount cacheline. If
this is a problem we can carefully maintain bits in the block to safely
indicate if it should be locked or unlocked but let's not go there if we
don't have to.
Signed-off-by: Zach Brown <zab@versity.com>
Reviewed-by: Mark Fasheh <mfasheh@versity.com>