From: Johannes Thumshirn <johannes.thumshirn@wdc.com> To: Damien Le Moal <Damien.LeMoal@wdc.com> Cc: linux-fsdevel@vger.kernel.org, Johannes Thumshirn <johannes.thumshirn@wdc.com> Subject: [PATCH] zonefs: count pages after truncating the iterator Date: Thu, 16 Jul 2020 19:37:23 +0900 [thread overview] Message-ID: <20200716103723.31983-1-johannes.thumshirn@wdc.com> (raw) 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) -- 2.26.2
next reply other threads:[~2020-07-16 10:37 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-16 10:37 Johannes Thumshirn [this message] 2020-07-20 9:07 ` Damien Le Moal
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=20200716103723.31983-1-johannes.thumshirn@wdc.com \ --to=johannes.thumshirn@wdc.com \ --cc=Damien.LeMoal@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).