All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Shilovsky <piastryyy@gmail.com>
To: Adam McCoy <adam@forsedomani.com>
Cc: Steve French <smfrench@gmail.com>,
	linux-cifs <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: fix leaked reference on requeued write
Date: Thu, 14 May 2020 15:13:11 -0700	[thread overview]
Message-ID: <CAKywueRRLGdpzjDMVh5DJzMO-AzzLNDWOZor5YstGenboi+Gpw@mail.gmail.com> (raw)
In-Reply-To: <20200514011748.GB5964@bionicboi>

ср, 13 мая 2020 г. в 18:18, Adam McCoy <adam@forsedomani.com>:
>
> > 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@microsoft.com>

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

--
Best regards,
Pavel Shilovsky

      reply	other threads:[~2020-05-14 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 11:53 [PATCH] cifs: fix leaked reference on requeued write Adam McCoy
2020-05-13 19:14 ` Steve French
2020-05-13 21:04   ` Steve French
2020-05-14  1:17     ` Adam McCoy
2020-05-14 22:13       ` Pavel Shilovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKywueRRLGdpzjDMVh5DJzMO-AzzLNDWOZor5YstGenboi+Gpw@mail.gmail.com \
    --to=piastryyy@gmail.com \
    --cc=adam@forsedomani.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.