On Tue, 2011-08-02 at 14:09 +0200, Jan Kara wrote: > Hello, > > Toshiyuki reported an ext3 error message which implies that we can have > unlinked but open files on read-only filesystem. Apparently open+unlink > races with remount in some way. Looking at code in do_remount_sb() I don't > see what prevents open("file", O_WRONLY) to happen after the check > fs_may_remount_ro() and before the filesystem is marked as read-only. > So are we expected to prevent these races? If yes, do I just miss something > or the above race is really there? Thanks for reply in advance. Yes, that race is there. I have a patchset to fix most of the races: https://lkml.org/lkml/2011/1/18/94 I'll update it to the current kernel. There's still one race that it doesn't fix, if the inode still has a stray reference not obtained from open() after nlink has gone to zero. This can be fixed by adding a counter similar to mnt_writers to the superblock and incrementing it in drop_nlink(). Thanks, Miklos > > Honza -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html