Browse Source

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>
Yan, Zheng 15 năm trước cách đây
mục cha
commit
a038fab0cb
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      fs/btrfs/ordered-data.c

+ 2 - 0
fs/btrfs/ordered-data.c

@@ -626,6 +626,8 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
 
 	if (ordered)
 		offset = entry_end(ordered);
+	else
+		offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize);
 
 	mutex_lock(&tree->mutex);
 	disk_i_size = BTRFS_I(inode)->disk_i_size;