Re: [PATCH 2/2] fuse: update stats for pages in dropped aux writeback list

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

 




On 8/20/24 2:24 AM, Joanne Koong wrote:
> In the case where the aux writeback list is dropped (eg the pages
> have been truncated or the connection is broken), the stats for
> its pages and backing device info need to be updated as well.
> 
> Fixes: e2653bd53a98 ("fuse: fix leaked aux requests")
> Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx>
> ---
>  fs/fuse/file.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 63fd5fc6872e..7ac56be5fee6 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1831,10 +1831,11 @@ __acquires(fi->lock)
>  	fuse_writepage_finish(wpa);
>  	spin_unlock(&fi->lock);
>  
> -	/* After fuse_writepage_finish() aux request list is private */
> +	/* After rb_erase() aux request list is private */
>  	for (aux = wpa->next; aux; aux = next) {
>  		next = aux->next;
>  		aux->next = NULL;
> +		fuse_writepage_finish(aux);
>  		fuse_writepage_free(aux);
>  	}
>  

LGTM.

Besides, there is similar logic of decreasing stats info for replaced
aux (temp) request inside fuse_writepage_add(), though without waking up
fi->page_waitq.

I wonder if we could factor out a new helper function, saying
fuse_writepage_dec_stat(), which could be called both from
fuse_writepage_add() and fuse_send_writepage().


-- 
Thanks,
Jingbo




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

  Powered by Linux