Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 03, 2011 at 10:17:32AM -0800, Linus Torvalds wrote:
> On Thu, Mar 3, 2011 at 9:45 AM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > How many mounted filesystems do you have that it's so hard to keep track of?
> 
> Btw, /proc/mounts will track them for you even if you don't have a
> 'mount' binary that does.
> 
> Parsing that is pretty trivial. If you have spaces or special
> characters in your pathnames (you may control the mount paths, you may
> not - I have no idea), you'll need to be able to handle the escape
> format (\oct). But other than that, it's literally just
> 
>  - read all of /proc/mounts into a buffer
> 
>  - for each line, split by space, and you'll have the directory name
> right there in the second field
> 
>  - do the unescaping ("\oct" -> character) if needed. It's good
> practice. Test it.
> 
>  - just do a read-only remount on it.
> 
> All done. No kernel changes necessary. It just works.

That or using setmntent() etc.

Thanks,
Dimitris
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux