lkml.org 
[lkml]   [1998]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: 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

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