lkml.org 
[lkml]   [2008]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC/PATCH 1/8]: CGroup Files: Add locking mode to cgroups control files
    On Tue, May 13, 2008 at 2:23 AM, Li Zefan <lizf@cn.fujitsu.com> wrote:
    > > +
    > > +/**
    > > + * cgroup_file_lock(). Helper for cgroup read/write methods.
    > > + * @cgrp: the cgroup being acted on
    > > + * @cft: the control file being written to or read from
    > > + * *write: true if the access is a write access.
    >
    > s/*write/@write
    >

    Fixed.

    > > @@ -1518,16 +1580,21 @@ static ssize_t cgroup_file_read(struct f
    > > struct cftype *cft = __d_cft(file->f_dentry);
    > > struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent);
    > >
    > > - if (!cft || cgroup_is_removed(cgrp))
    > > + if (cgroup_is_removed(cgrp))
    > > return -ENODEV;
    > >
    >
    > This check seems redundant now.
    >

    It's not needed for safety, but it doesn't seem to hurt to check
    cgroup_is_removed() prior to doing any copying, since we'll fail after
    copying anyway if cgroup_is_removed() returns true (once we've taken
    any relevant locks).

    Paul


    \
     
     \ /
      Last update: 2008-05-13 23:11    [W:4.177 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site