Re: [PATCH] cifs: fix leaked reference on requeued write

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

 



ср, 13 мая 2020 г. в 18:18, Adam McCoy <adam@xxxxxxxxxxxxxxx>:
>
> > Part of this makes sense Pavel reminded me:
> >       in cifs_writepages() we don't need to reference wdata because we
> > are leaving the function. in cifs_write_from_iter() we put all wdatas
> > in the list and that's why we need an extra reference there
>
> Yes, this looks right. cifs_writev_requeue() seems to work like
> cifs_writepages() in that the wdata2 reference disappears when the loop
> exits. If the loop iterates a new struct is created each time.
>
> > and wouldn't there be an underrun if a retryable error with your patch
> > with it getting called twice?
>
> There shouldn't be any difference if there is any kind of write error
> (rc != 0), since the put call is just moving. The only difference
> should be that the put call will happen if the write succeeds.
>

Thanks for the patch! Good catch!

Reviewed-by: Pavel Shilovsky <pshilov@xxxxxxxxxxxxx>

This is the old code and the problem is important to fix, so, stable
tag is needed.

--
Best regards,
Pavel Shilovsky




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux