Re: [PATCH][next] printk: ringbuffer: support dataless records

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

 



On (20/07/20 16:07), John Ogness wrote:
>  
> +/* Determine if a logical position refers to a data-less block. */
> +#define LPOS_DATALESS(lpos)		((lpos) & 1UL)
> +

[..]

> @@ -1402,7 +1396,9 @@ static int prb_read(struct printk_ringbuffer *rb, u64 seq,
>  	/* Copy text data. If it fails, this is a data-less record. */
>  	if (!copy_data(&rb->text_data_ring, &desc.text_blk_lpos, desc.info.text_len,
>  		       r->text_buf, r->text_buf_size, line_count)) {
> -		return -ENOENT;
> +		/* Report an error if there should have been data. */
> +		if (desc.info.text_len != 0)
> +			return -ENOENT;
>  	}

If this is a dataless record then should copy_data() return error?

Otherwise, looks good to me
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>

	-ss

_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux