The patch titled cgroups: show correct file mode, fix has been added to the -mm tree. Its filename is cgroups-show-correct-file-mode-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: cgroups: show correct file mode, fix From: Li Zefan <lizf@xxxxxxxxxxxxxx> - 'mode' should have type mode_t - use S_IRUGO/S_IWUSR instead of 0444/0200 Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx> Cc: Paul Menage <menage@xxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/cgroup.h | 2 +- kernel/cgroup.c | 24 ++++++++++++------------ kernel/cpuset.c | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff -puN include/linux/cgroup.h~cgroups-show-correct-file-mode-fix include/linux/cgroup.h --- a/include/linux/cgroup.h~cgroups-show-correct-file-mode-fix +++ a/include/linux/cgroup.h @@ -262,7 +262,7 @@ struct cftype { * If not 0, file mode is set to this value, otherwise it will * be figured out automatically */ - int mode; + mode_t mode; /* * If non-zero, defines the maximum length of string that can diff -puN kernel/cgroup.c~cgroups-show-correct-file-mode-fix kernel/cgroup.c --- a/kernel/cgroup.c~cgroups-show-correct-file-mode-fix +++ a/kernel/cgroup.c @@ -1686,7 +1686,7 @@ static struct inode_operations cgroup_di .rename = cgroup_rename, }; -static int cgroup_create_file(struct dentry *dentry, int mode, +static int cgroup_create_file(struct dentry *dentry, mode_t mode, struct super_block *sb) { static struct dentry_operations cgroup_dops = { @@ -1732,7 +1732,7 @@ static int cgroup_create_file(struct den * @mode: mode to set on new directory. */ static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, - int mode) + mode_t mode) { struct dentry *parent; int error = 0; @@ -1755,24 +1755,24 @@ static int cgroup_create_dir(struct cgro * @cft: the control file in question * * returns cft->mode if ->mode is not 0 - * returns 0644 if it has both a read and a write handler - * returns 0444 if it has only a read handler - * returns 0200 if it has only a write hander + * returns S_IRUGO|S_IWUSR if it has both a read and a write handler + * returns S_IRUGO if it has only a read handler + * returns S_IWUSR if it has only a write hander */ -static int cgroup_file_mode(const struct cftype *cft) +static mode_t cgroup_file_mode(const struct cftype *cft) { - int mode = 0; + mode_t mode = 0; if (cft->mode) return cft->mode; if (cft->read || cft->read_u64 || cft->read_s64 || cft->read_map || cft->read_seq_string) - mode |= 0444; + mode |= S_IRUGO; if (cft->write || cft->write_u64 || cft->write_s64 || cft->write_string || cft->trigger) - mode |= 0200; + mode |= S_IWUSR; return mode; } @@ -1784,7 +1784,7 @@ int cgroup_add_file(struct cgroup *cgrp, struct dentry *dir = cgrp->dentry; struct dentry *dentry; int error; - int mode; + mode_t mode; char name[MAX_CGROUP_TYPE_NAMELEN + MAX_CFTYPE_NAME + 2] = { 0 }; if (subsys && !test_bit(ROOT_NOPREFIX, &cgrp->root->flags)) { @@ -2378,7 +2378,7 @@ static struct cftype files[] = { .write_u64 = cgroup_tasks_write, .release = cgroup_tasks_release, .private = FILE_TASKLIST, - .mode = 0644, + .mode = S_IRUGO | S_IWUSR, }, { @@ -2479,7 +2479,7 @@ static void cgroup_unlock_hierarchy(stru * Must be called with the mutex on the parent inode held */ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, - int mode) + mode_t mode) { struct cgroup *cgrp; struct cgroupfs_root *root = parent->root; diff -puN kernel/cpuset.c~cgroups-show-correct-file-mode-fix kernel/cpuset.c --- a/kernel/cpuset.c~cgroups-show-correct-file-mode-fix +++ a/kernel/cpuset.c @@ -1706,7 +1706,7 @@ static struct cftype files[] = { .read_u64 = cpuset_read_u64, .write_u64 = cpuset_write_u64, .private = FILE_MEMORY_PRESSURE, - .mode = 0444, + .mode = S_IRUGO, }, { _ Patches currently in -mm which might be from lizf@xxxxxxxxxxxxxx are linux-next.patch vfs-add-missing-unlock-in-sget.patch relax-ns_can_attach-checks-to-allow-attaching-to-grandchild-cgroups.patch cgroup-css-id-support.patch cgroup-fix-frequent-ebusy-at-rmdir.patch cgroups-more-documentation-for-remount-and-release_agent.patch cgroups-show-correct-file-mode.patch cgroups-show-correct-file-mode-fix.patch memcg-use-css-id.patch memcg-hierarchical-stat.patch memcg-fix-shrinking-memory-to-return-ebusy-by-fixing-retry-algorithm.patch memcg-fix-oom-killer-under-memcg.patch memcg-fix-oom-killer-under-memcg-fix2.patch memcg-fix-oom-killer-under-memcg-fix.patch memcg-show-memcg-information-during-oom.patch memcg-show-memcg-information-during-oom-fix2.patch memcg-show-memcg-information-during-oom-fix.patch memcg-show-memcg-information-during-oom-fix-fix.patch memcg-show-memcg-information-during-oom-fix-fix-checkpatch-fixes.patch use-css-id-in-swap_cgroup-for-saving-memory-v4.patch cpuset-fix-possible-races-in-cpu-memory-hotplug.patch cgroups-add-data-field-to-struct-cgroup_scanner.patch cpuset-rewrite-update_tasks_nodemask.patch cpuset-avoid-changing-cpusets-mems-when-errno-returned.patch cpuset-remove-struct-cpuset_hotplug_scanner.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html