Re: [PATCH 1/2] fix bad behavior in use_hierarchy file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(cc'ing Li)

Hello, Andrew.

On Tue, Jun 26, 2012 at 03:25:22PM -0700, Andrew Morton wrote:
> hm.  The various .write_u64() implementations go and return zero on
> success and cgroup_write_X64() sees this and rewrites the return value
> to `nbytes'.
> 
> That was a bit naughty of us - it prevents a .write_u64() instance from
> being able to fully implement a partial write.  We can *partially*
> implement a partial write, by returning a value between 1 and nbytes-1,
> but we can't return zero.  It's a weird interface, it's a surprising
> interface and it was quite unnecessary to do it this way.  Someone
> please slap Paul.
> 
> It's hardly a big problem I, but that's why the unix write() interface
> was designed the way it is.

The whole file interface is severely over-designed like a lot of other
things in cgorup.  I'm thinking about consolidating all the different
read/write methods into one generic pair, likely based on seq_file and
make all others helpers.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux