Corruption caused by umount not flushing the buffer cache.

From: James Bottomley (James.Bottomley@columbiasc.ncr.com)
Date: Mon Jan 24 2000 - 20:42:44 EST


There's a problem in 2.2.14 (and possibly 2.3.40) caused by do_umount (in
fs/super.c) calling invalidate_inodes() but not invalidate_buffers(). I
believe this only affects storage which is shared between boxes either on a
SCSI bus or a SAN, but it's biting me:

If I mount the filesystem on Node A, modify it and unmount it. Then I mount
the same filesystem on Node B, modify it and unmount it. Finally I mount it
again on node A; because the buffers weren't invalidated on Node A this node
will potentially have stale buffers in the buffer cache which will corrupt the
filesystem if I try to modify it again.

I know I can get around this by forcing a BLKFLSBUF ioctl to the device after
the unmount but this strikes me as a bug in the linux umount semantics which
will bite more people than just me as linux enters the SAN arena.

I think the fix is simple (and I attach it below).

James Bottomley



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:13 EST