Re: [PATCH] cgroup: Zero sized write should be no-op

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

 



Hi,

thanks for the feedback.

The 09/30/2020 12:06, Tejun Heo wrote:
> On Wed, Sep 30, 2020 at 06:03:57PM +0200, Michal Koutný wrote:
> > On Mon, Sep 28, 2020 at 04:10:13PM +0300, Jouni Roivas <jouni.roivas@xxxxxxxxxx> wrote:
> > > Do not report failure on zero sized writes, and handle them as no-op.
> > This is a user visible change (in the case of a single write(2)), OTOH,
> > `man write` says:
> > > If count is zero and fd refers to a file other than a regular file,
> > > the results are not specified.
> 
> So, I'm not necessarily against the change, mostly in the spirit of "why
> not?".

There's actual user space application failing because of this. Of course
can to fix the app, but think it's better to fix kernel as well. At
least prevents possible similar failures in future.

> > > @@ -3682,6 +3700,9 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
> > >  	struct cgroup_subsys_state *css;
> > >  	int ret;
> > >  
> > > +	if (!nbytes)
> > > +		return 0;
> > > +
> > >  	/*
> > >  	 * If namespaces are delegation boundaries, disallow writes to
> > >  	 * files in an non-init namespace root from inside the namespace
> > Shouldn't just this guard be sufficient? 
> 
> But yeah, please do it in one spot.

Thought it would be good to add everywhere, but will clean up the patch
and resubmit.



[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