Messages in this thread | | | Date | Wed, 7 Oct 1998 21:37:45 -0400 (EDT) | From | "Albert D. Cahalan" <> | Subject | Re: unremovable files and possible fs corruption (2.1.123) |
| |
Theodore Y. Ts'o: >> From: "Stephen C. Tweedie"
>>> 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!
Please, make it a union! Every filesystem has a few odd features. The kernel itself has a union in the inode data. The system call needs that too.
If glibc would pass a size parameter, the structure could be extended by adding to the end. Something like:
stat { inode size filesystem_type <-- needed to interpret the union struct_size <-- needed to interpret the union ctime atime mtime ... reserved[42] union { ext2 { ext2flags version } vfat { shortname fatflags } } }
- 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/
| |