lkml.org 
[lkml]   [1998]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: ext2fs: inode with zero dtime
Hi,

On Tue, 25 Aug 1998 13:42:31 +0100, Delman Lee <delman@sharp.co.uk>
said:

> . Run "ldconfig" which generates a new ld.so.cache. (/etc/ld.so.cache
> is mmapped)

> . Run "mount -o remount,ro /", followed by "fsck -f /dev/hda?" shows
> an inode with zero dtime. The inode is that of /etc/ld.so.cache before
> ldconfig is run.

That's the problem: it should be illegal to remount a fs readonly while
there are still orphaned deleted inodes present.

The problem is that closing such an inode acts as a delete. If the fs
is readonly at the time, then either we cannot complete the delete on
disk, or we have to fail the close. Either way lands us in a mess. The
alternative is to prevent the fs from being marked readonly until these
inodes finally get cleaned up.

Linus, I've already sent a patch to do this. It's a genuine bug: we
can't expect a filesystem to deal cleanly with VFS write requests after
the VFS has already told the fs to become readonly. Patch resent below.
This does not introduce any new failure modes; at worst, it converts the
current behaviour (silently corrupt the fs) into a noisy one (error
reported when we try to remount the fs readonly).

--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:0.727 / U:1.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site