lkml.org 
[lkml]   [2011]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Syscalls: reboot: Add options to the reboot syscall to remount filesystems ro
From
Thanks for the feedback.  I suspected the kernel community might not
like this change. The suggestions by Linus seem worth trying out.

___
Ken


On Thu, Mar 3, 2011 at 10:29 AM, Mark Lord <kernel@teksavvy.com> wrote:
> On 11-03-03 01:17 PM, Linus Torvalds wrote:
>> On Thu, Mar 3, 2011 at 9:45 AM, Linus Torvalds
>> <torvalds@linux-foundation.org> 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.
>
>
> This might be much less complex:
>
>   #!/bin/sh
>   echo s > /proc/sysrq-trigger
>   echo u > /proc/sysrq-trigger
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-03-04 00:25    [W:0.863 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site