lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210415144600.GB2069063@infradead.org>
Date:   Thu, 15 Apr 2021 15:46:00 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Zhang Yi <yi.zhang@...wei.com>
Cc:     linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        tytso@....edu, adilger.kernel@...ger.ca, jack@...e.cz,
        yukuai3@...wei.com
Subject: Re: [RFC PATCH v2 4/7] jbd2: do not free buffers in
 jbd2_journal_try_to_free_buffers()

On Wed, Apr 14, 2021 at 09:47:34PM +0800, Zhang Yi wrote:
>  static int blkdev_releasepage(struct page *page, gfp_t wait)
>  {
>  	struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
> +	int ret = 0;
>  
>  	if (super && super->s_op->bdev_try_to_free_page)
> +		ret = super->s_op->bdev_try_to_free_page(super, page, wait);
> +	if (!ret)
> +		return try_to_free_buffers(page);
> +	return 0;

This would rea much better as:

	if (super && super->s_op->bdev_try_to_free_page &&
	    super->s_op->bdev_try_to_free_page(super, page, wait)
		return 0;
	return try_to_free_buffers(page);

and I think changing ->bdev_try_to_free_page to return a bool where true
means "yes, free the buffers" and false means "don't free buffers" would
be a better calling convention.

Also please split the changes to the method signature from the ext4
internal cleanups.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ