Re: [PATCH -next 1/2] seq_puts: Convert to return void and convert uses too.

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

 



On Mon 2014-11-10 10:58:56, Joe Perches wrote:
> diff --git a/ipc/util.c b/ipc/util.c
> index 106bed0..4f726b7 100644
> --- a/ipc/util.c
> +++ b/ipc/util.c
> @@ -837,8 +837,10 @@ static int sysvipc_proc_show(struct seq_file *s, void *it)
>  	struct ipc_proc_iter *iter = s->private;
>  	struct ipc_proc_iface *iface = iter->iface;
>  
> -	if (it == SEQ_START_TOKEN)
> -		return seq_puts(s, iface->header);
> +	if (it == SEQ_START_TOKEN) {
> +		seq_puts(s, iface->header);
> +		return seq_has_overflowed(s);

It should return 0. The overflow is detected by traverse() that is
called from seq_read(). If the overflow happens, the size of the
buffer is increased and show() is called again.

> +	}
>  
>  	return iface->show(s, it);

This should stay as is. It seems that the show() function might also
return negative value in case of some other failure. See the error
handling of "error = m->op->show(m, p);" in traverse() in fs/seq_file.c


The rest of the patch looks fine.

Best Regards,
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux