linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] zonefs: count pages after truncating the iterator
Date: Mon, 20 Jul 2020 09:07:38 +0000	[thread overview]
Message-ID: <CY4PR04MB375103032433640A11A7CC6CE77B0@CY4PR04MB3751.namprd04.prod.outlook.com> (raw)
In-Reply-To: <20200716103723.31983-1-johannes.thumshirn@wdc.com>

On 2020/07/16 19:37, Johannes Thumshirn wrote:
> Count pages after possible truncating the iterator to the maximum zone
> append size, not before.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/zonefs/super.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 5b7ced5c643b..116bad28cd68 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -607,13 +607,14 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
>  	int nr_pages;
>  	ssize_t ret;
>  
> +	max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +	max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> +	iov_iter_truncate(from, max);
> +
>  	nr_pages = iov_iter_npages(from, BIO_MAX_PAGES);
>  	if (!nr_pages)
>  		return 0;
>  
> -	max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> -	max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> -	iov_iter_truncate(from, max);
>  
>  	bio = bio_alloc_bioset(GFP_NOFS, nr_pages, &fs_bio_set);
>  	if (!bio)
> 

Applied to for-5.8-fixes, minus the extra blank line before bio_alloc_bioset().
Thanks !

-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2020-07-20  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 10:37 Johannes Thumshirn
2020-07-20  9:07 ` Damien Le Moal [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=CY4PR04MB375103032433640A11A7CC6CE77B0@CY4PR04MB3751.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [PATCH] zonefs: count pages after truncating the iterator' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).