Skip to content

Commit a038fab

Browse files
ukernelchrismason-xx
authored andcommitted
Btrfs: align offsets for btrfs_ordered_update_i_size
Some callers of btrfs_ordered_update_i_size can now pass in a NULL for the ordered extent to update against. This makes sure we properly align the offset they pass in when deciding how much to bump the on disk i_size. Signed-off-by: Chris Mason <chris.mason@oracle.com>
1 parent 406266a commit a038fab

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/btrfs/ordered-data.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
626626

627627
if (ordered)
628628
offset = entry_end(ordered);
629+
else
630+
offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize);
629631

630632
mutex_lock(&tree->mutex);
631633
disk_i_size = BTRFS_I(inode)->disk_i_size;

0 commit comments

Comments
 (0)