[PATCH] afs: Fix partial writeback of large files on fsync and close

Jeffrey E Altman jaltman at auristor.com
Fri Jun 4 15:40:46 PDT 2021


On 6/4/2021 1:55 PM, Marc Dionne (marc.c.dionne at gmail.com) wrote:
> From: Marc Dionne <marc.dionne at auristor.com>
> 
> In commit e87b03f5830e ("afs: Prepare for use of THPs"), the return
> value for afs_write_back_from_locked_page was changed from a number
> of pages to a length in bytes.  The loop in afs_writepages_region uses
> the return value to compute the index that will be used to find dirty
> pages in the next iteration, but treats it as a number of pages and
> wrongly multiplies it by PAGE_SIZE.  This gives a very large index value,
> potentially skipping any dirty data that was not covered in the first
> pass, which is limited to 256M.
> 
> This causes fsync(), and indirectly close(), to only do a partial
> writeback of a large file's dirty data.  The rest is eventually written
> back by background threads after dirty_expire_centisecs.
> 
> Fixes: e87b03f5830e ("afs: Prepare for use of THPs")
> Signed-off-by: Marc Dionne <marc.dionne at auristor.com>

Reviewed-by: Jeffrey Altman <jaltman at auristor.com>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: jaltman.vcf
Type: text/x-vcard
Size: 271 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20210604/71451acb/attachment.vcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20210604/71451acb/attachment.sig>


More information about the linux-afs mailing list