[lkml]   [1998]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectStrange behaviour of file systems

I am figuring out the behaviour of buffer cache and have been facing a
strange problems.
I am creating a test directory and copying some ascii files to that directory
after which
I do a sync and then execute the command
"cat /mnt/*" in a loop where /mnt is the mount point for that device.
In the middle of this operation, I shutdown my machine. The next time I reboot
the machine,
the device is corrupted and after doing e2fsck on that, half the files are
corrupted. My
doubt is cat should open all the files in read only mode; then why is the file
system getting
modified. My understanding is fs will be put in an inconsistent state only if
there are dirty
buffers/inodes not yet flushed and the shutdown occurs. Here I am making sure
that all my
buffers are flushed back( I go thru the OS's buffer cache and print out all
the dirty buffers
for the device; there are none) and I am opening the files in read only mode.
How does the
file system reach an inconsistent state?

Thanks and Regards


Member of Technical Staff,
Oracle Software India Ltd.

e-mail :

Phone : 2283004, 2283005 Ext 1027


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:46    [W:0.045 / U:1.676 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site