Re: [PATCH 1/1] snic_trc_seq_next should increase position index

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

 



James, Martin,
I did not get any feedback from Cisco developers,
could you please pick up this patch?

Unfortunately I have no related hardware and cannot verify the patch.

Usually you can observe following related problems:
- read after lseek beyond end of file, described by NeilBrown in  
 commit 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface")
 "dd if=<AFFECTED_FILE> bs=1000 skip=1" will incorrectly generate whole last line

- read after lseek on into middle of last line will output expected rest of
 last line but then repeat whole last line once again. 

- If .show() function generates multi-line output following bash script will never finish.

 $ q=;while read -r r;do echo "$((++q)) $r";done < AFFECTED_FILE

On 1/24/20 8:56 AM, Vasily Averin wrote:
> if seq_file .next fuction does not change position index,
> read after some lseek can generate unexpected output.
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=206283
> Signed-off-by: Vasily Averin <vvs@xxxxxxxxxxxxx>
> ---
>  drivers/scsi/snic/snic_debugfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/snic/snic_debugfs.c b/drivers/scsi/snic/snic_debugfs.c
> index 2b34936..b20c724 100644
> --- a/drivers/scsi/snic/snic_debugfs.c
> +++ b/drivers/scsi/snic/snic_debugfs.c
> @@ -419,6 +419,7 @@ void snic_stats_debugfs_init(struct snic *snic)
>  static void *
>  snic_trc_seq_next(struct seq_file *sfp, void *data, loff_t *pos)
>  {
> +	(*pos)++;
>  	return NULL;
>  }
>  
> 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux