Re: [PATCH v2] zonefs: fix page reference and BIO leak

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

 



On 12/9/20 17:41, Damien Le Moal wrote:
> In zonefs_file_dio_append(), the pages obtained using
> bio_iov_iter_get_pages() are not released on completion of the
> REQ_OP_APPEND BIO, nor when bio_iov_iter_get_pages() fails.
> Furthermore, a call to bio_put() is missing when
> bio_iov_iter_get_pages() fails.
>
> Fix these resource leaks by adding BIO resource release code (bio_put()i
I think extra 'i' above needs to be removed at the time of applying the
patch.
> and bio_release_pages()) at the end of the function after the BIO
> execution and add a jump to this resource cleanup code in case of
> bio_iov_iter_get_pages() failure.
>
> While at it, also fix the call to task_io_account_write() to be passed
> the correct BIO size instead of bio_iov_iter_get_pages() return value.
>
> Reported-by: Christoph Hellwig <hch@xxxxxx>
> Fixes: 02ef12a663c7 ("zonefs: use REQ_OP_ZONE_APPEND for sync DIO")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx>
Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux