Re: unremovable files and possible fs corruption (2.1.123)

Theodore Y. Ts'o (tytso@mit.edu)
Wed, 7 Oct 1998 15:27:09 -0400


Date: Wed, 7 Oct 1998 13:08:51 +0100
From: "Stephen C. Tweedie" <sct@redhat.com>

> lsattr/chattr doesn't work on device nodes.

<sigh> I know. debugfs is the only answer for now, but I'll be adding
the hooks necessary for chattr on arbitrary inodes in the future.

A minimal amount of the hooks are already there. If you look in
linux/fs.h, there's already definitions for ATTR_FLAG_SYNCHRONOUS,
ATTR_FLAG_IMMUTABLE, etc. in the i_attr_flags field of the inode
attribute structures, and the ext2's notify_change() already handles the
ext2-specific part of chattr on arbitrary inodes. So the ext2fs hooks
are already present and implemented.

What's missing is the VFS code and the actual system call interface to
actually support the ext2-specific code. My original intention was to
model things using the BSD interface, chflags(), since it already exists
and there's no point inventing a new interface. The issue was that the
BSD interface did not have a getflags() system call, but rather added a
field in struct stat --- which is ultimately the right thing to do ---
and I got hung up there being no easy way of doing that.

But now that glibc is around, it should be pretty easy to add this field
to struct stat, and then add the chflags system call. Stephen, if you
want to try tackling this, that would be great!

- Ted

-
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.tux.org/lkml/