Truncate dirties zero tail extension

When we truncate away from a partial block we need to zero its tail that
was past i_size and dirty it so that it's written.

We missed the typical vfs boilerplate of calling block_truncate_page
from setattr->set_size that does this.  We need to be a little careful
to pass our file lock down to get_block and then queue the inode for
writeback so its written out with the transaction.  This follows the
pattern in .write_end.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2022-12-06 10:31:31 -08:00
parent 87500e8bb5
commit 8e067b3d3f
3 changed files with 15 additions and 2 deletions
+2 -2
View File
@@ -631,8 +631,8 @@ static int scoutfs_get_block_read(struct inode *inode, sector_t iblock,
return ret;
}
static int scoutfs_get_block_write(struct inode *inode, sector_t iblock,
struct buffer_head *bh, int create)
int scoutfs_get_block_write(struct inode *inode, sector_t iblock, struct buffer_head *bh,
int create)
{
struct scoutfs_inode_info *si = SCOUTFS_I(inode);
int ret;