From: "Aurélien Aptel" <aaptel@suse.com>
To: 亿一 <teroincn@gmail.com>, sfrench@samba.org
Cc: linux-cifs@vger.kernel.org
Subject: Re: [BUG] fs: cifs : does there exist a memleak in function cifs_writev_requeue
Date: Mon, 20 Apr 2020 13:04:23 +0200 [thread overview]
Message-ID: <87lfmq2zbc.fsf@suse.com> (raw)
In-Reply-To: <CANTwqXDyh0Vvc=bgCMafGFLtheDtn31=ffDkg++2qn+RWq=vMQ@mail.gmail.com>
Hi,
亿一 <teroincn@gmail.com> writes:
> Hi all:
> When reviewing the code of function cifs_writev_requeue, wdata2
> allocated in while loop.
> however, if wdata2->cfile is NULL, the loop break without release
> wdata2, there exists a memleak of wdata2?
Yes, good catch. It was fixed last year by the following commit:
commit 165df9a080b6
Author: Pavel Shilovsky <pshilov@microsoft.com>
Date: Tue Jan 29 16:40:28 2019 -0800
CIFS: Fix leaking locked VFS cache pages in writeback retry
If we don't find a writable file handle when retrying writepages
we break of the loop and do not unlock and put pages neither from
wdata2 nor from the original wdata. Fix this by walking through
all the remaining pages and cleanup them properly.
Cheers,
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
prev parent reply other threads:[~2020-04-20 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 9:20 [BUG] fs: cifs : does there exist a memleak in function cifs_writev_requeue 亿一
2020-04-20 11:04 ` Aurélien Aptel [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=87lfmq2zbc.fsf@suse.com \
--to=aaptel@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=sfrench@samba.org \
--cc=teroincn@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.