Question for remount

From: KAMEZAWA Hiroyuki
Date: Fri Feb 20 2009 - 05:03:50 EST



Followings are 3 stories of remount cgroup,

1. remount with devices.

# mount -t cgroup none /cgroups -ocpuacct,release_agent=xxx
# echo > /cgroups/release_agent #clear release agent by hand
# mount -t cgroup none /cgroups -oremount,cpuacct
# cat /cgroups/release_agent
=> release_agent is ""

2. remount without devices, mount command will read /proc/mounts and
copies option.

# mount -t cgroup none /cgroups -ocpuacct,release_agent=xxx
# echo > /cgroups/release_agent #clear release agent by hand
# mount /cgroups -oremount,cpuacct #don't specify device
# cat /cgroups/release_agent
=> xxx

Hmm, release_agent is copied from /proc/mounts and release_agent revives.

3. remount without devices, mount command will read /proc/mounts
# mount -t cgroup none /cgroups -ocpuacct,release_agent=xxx
# mount /cgroups -oremount,cpuacct,release_agent=xxx
=> error
"release_agent=" will be found twice and this returns -INVAL

maybe case "2" is not ideal, I think. (but it may not be bug.)

My point is following.

1. Documentation/cgroups/cgroup.txt says
#mount -oremount,cpuset,ns /dev/cgroup
But this should be
#mount -tcgroup none /dev/cgroup -oremount,cpuset,ns

2. /proc/mounts information of release_agent should be updated....
when it's overwritten directly.

3. If "2" is impossible, changing release_agent at remount should not be allowed.

How do you think ?

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/