Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262945

Re: [PATCH cgroup/for-4.4-fixes] cgroup: fix cftype->file_offset handling

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH cgroup/for-4.4-fixes] cgroup: fix cftype->file_offset handling
Date 2015-11-05 07:00 +0100
Message-ID <qrlKy-2wU-7@gated-at.bofh.it> (permalink)
References <qrl7P-2g9-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 05, 2015 at 12:12:24AM -0500, Tejun Heo wrote:
> 6f60eade2433 ("cgroup: generalize obtaining the handles of and
> notifying cgroup files") introduced cftype->file_offset so that the
> handles for per-css file instances can be recorded.  These handles
> then can be used, for example, to generate file modified
> notifications.
> 
> Unfortunately, it made the wrong assumption that files are created
> once for a given css and removed on its destruction.  Due to the
> dependencies among subsystems, a css may be hidden from userland and
> then later shown again.  This is implemented by removing and
> re-creating the affected files, so the associated kernfs_node for a
> given cgroup file may change over time.  This incorrect assumption led
> to the corruption of css->files lists.
>
> Reimplement cftype->file_offset handling so that cgroup_file->kn is
> protected by a lock and updated as files are created and destroyed.
> This also makes keeping them on per-cgroup list unnecessary.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: James Sedgwick <jsedgwick@fb.com>
> Fixes: 6f60eade2433 ("cgroup: generalize obtaining the handles of and notifying cgroup files")

Kudos to whoever debugged this.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH cgroup/for-4.4-fixes] cgroup: fix cftype->file_offset handling Tejun Heo <tj@kernel.org> - 2015-11-05 06:20 +0100
  Re: [PATCH cgroup/for-4.4-fixes] cgroup: fix cftype->file_offset  handling Johannes Weiner <hannes@cmpxchg.org> - 2015-11-05 07:00 +0100
  Re: [PATCH cgroup/for-4.4-fixes] cgroup: fix cftype->file_offset  handling Zefan Li <lizefan@huawei.com> - 2015-11-07 08:50 +0100

csiph-web