Re: [BUG] fs: cifs : does there exist a memleak in function cifs_writev_requeue

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

 



Hi,

亿一 <teroincn@xxxxxxxxx> 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@xxxxxxxxxxxxx>
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)



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

  Powered by Linux