I'm writing a patch to the ext3 fs. I thought that if I incremented the s_active field in the super_block struct, the user would be unable to umount the filesystem until I decremented the s_active count. But things seem to be different... If the user issues an umount command, he can still umount the filesystem and just gets a warning. My question is: how do I prevent the user from umounting the filesystem? Thank you, Donato Capitella
On Fri, 12 Jun 2009, Donato Capitella wrote:> If the user issues an umount command, he can still umount the filesystem > and just gets a warning.Why is the user (!root) allowed to unmount anyway? I guess the "user" or "owner" option has been used when the fileystem was mounted?> My question is: how do I prevent the user from umounting the filesystem?What are you really trying to do? If a mere user was allowed to /mount/ why do you want to disallow /unmounting/? Maybe sudo(8) can help: allow the user to /mount/ but remove the "user" and "owner" option from fstab - that way a user can still mount but it's not "her" mount any more, thus umount will fail. Christian. -- BOFH excuse #377: Someone hooked the twisted pair wires into the answering machine.
[Cc'ing ext3-users again] On Sun, 14 Jun 2009, Donato Capitella wrote:> Well, that's not it. > > I modified the ext3 fs and added a kernel thread that performs deferred > operations. As long as this thread is working, I would like the file > system not to be unmounted.I still don't understand the reasoning here: "not to be unmounted" as in a permission-bound issue ("is not allowed to unmount") or a technical issue? For the latter: simply keep an open file on the filesystem, unmount will fail with -EBUSY. Or it's a matter of "because we can", as in "because I want to be able to disallow mounting on the filesystem level". But then again, I did not have my coffee yet and my brain keeps asking why, why, why? :) Christian. -- BOFH excuse #202: kernel panic: write-only-memory (/dev/wom0) capacity exceeded.