Messages in this thread Patch in this message | | | Date | Mon, 24 Aug 1998 14:32:46 +0100 | From | "Stephen C. Tweedie" <> | Subject | PATCH: Fix for remount-ro |
| |
Hi,
Currently fs_may_umount_ro has a problem which allows it to permit a readonly remount even if there is write activity pending on the fs. The problem is the special case recently pointed out on l-k where we have an open file descriptor on a deleted file (i_nlink==0). Closing that fd will cause the file to be deleted on disk, even though the filesystem has been remounted readonly.
In the absence of explicit filesystem support for this special case (such as the readonly remount recording a list of files waiting for delete before freezing the disk), we need to prevent such dismounts from happening. Trivial patch against 2.1.117 follows.
This should not break anything new, but it may convert problems with existing, broken shutdown scripts from silent failures to noisy ones. It's best to know about it if it happens, though.
--Stephen ---------------------------------------------------------------- --- fs/inode.c~ Wed Aug 19 15:27:30 1998 +++ fs/inode.c Mon Aug 24 14:06:45 1998 @@ -770,7 +770,8 @@ inode = file->f_dentry->d_inode; if (!inode || inode->i_sb != sb) continue; - if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE) + if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE || + inode->i_nlink == 0)) return 0; } return 1; /* Tis' cool bro. */ ---------------------------------------------------------------- - 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.altern.org/andrebalsa/doc/lkml-faq.html
| |