Welcome! Log In Create A New Profile


Modifying what gets put into /proc/mounts without confusing the filesystems

Posted by thekevinday 
Modifying what gets put into /proc/mounts without confusing the filesystems
June 03, 2008 08:40PM
I was originally going to put this in the filesystems forum, feel free to move this if it should in fact be there instead of here.

I wrote a patch for util-linux that allows me to exclusively use /proc/mounts over /etc/mtab, given that I could see no difference between the two.
I quickly found out that the /proc/mounts does not append the user=blah option to specify that some non-root user should be able to umount the device.
I then followed with a new patch that effectively appends the option umount=somegid.

I am using umount= so that I do not conflict with any special parameters in existing filesystems.

The problem is that I am trying to look through the kernel to see what I need to change to allow /proc/mounts to have umount=somegid and not have the filesystem upchuck because it does not recognize the umount=somegid option.

I can see the good way and the bad way to implement this.
The good way would be to remove the umount=somegid option after it gets placed into /proc/mounts and before the options get passed to the filesystem.
The bad way would be to tweak every single filesystem and have them explicitly ignore the umount=somegid option.

I am having trouble finding in the linux source, where in the code I need to make this change and remove the umount=somegid option.

Could I get some help?
I would really like to avoid the bad way.

I am currently looking at the file: fs/namespace.c

Your Email:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 10 plus 16?