Incorporating a small change in inode structure: please help

Nifty Hat Mitch mitch48 at sbcglobal.net
Wed Oct 27 20:44:32 UTC 2004


On Wed, Oct 27, 2004 at 04:47:45PM +0530, Kaustubh Ghosh wrote:
> 
> Hi all,

>     what I want is to incorporate one extra field of information in
>     the inode > structure. Can anybody tell me where I will find the
>     definition of inode so > that I can add the extra field.What
>     will be the other causes of concern, and > what more functions
>     accessing the inodes will I need to change?

The list is long.  As a minimum for ext[23] filesystems will be any
program that includes:

    /usr/include/linux/ext2_fs.h
    /usr/include/linux/ext3_fs.h

The most important ones will be making the filesystem and repairing
the fs, also mount and the kernel modules.  The smallest change might
as well be a big change.

Do you realize that if you fiddle with the inode then it is no longer
ext2/ext3 and future software installs and updates will cause things
to fail, BADLY!  Do not call your changed ext[23]...

You might look at the mechanism that SELinux takes advantage of 
extended attributes in the inode for your experiment.

For example ls has the flags -Z and --lcontext.
    $ ls --lcontext /
    total 339
    drwxr-xr-x    6 system_u:object_r:default_t      root root   4096 Apr 10  2004 b
    ....

By taking advandage of existing extended atributes you will not break
the filesystem structure and the additional data is only
important when your kernel changes inspect, check, and modify 
your attribute.

There is risk in such changes.  You need at least a second spare
tester machine to play with this stuff.


-- 
	T o m  M i t c h e l l 
	May your cup runneth over with goodness and mercy
	and may your buffers never overflow.




More information about the fedora-list mailing list