Skip to content

Commit 051df24

Browse files
committed
Merge tag 'for-5.14-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba: - fix -Warray-bounds warning, to help external patchset to make it default treewide - fix writeable device accounting (syzbot report) - fix fsync and log replay after a rename and inode eviction - fix potentially lost error code when submitting multiple bios for compressed range * tag 'for-5.14-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: calculate number of eb pages properly in csum_tree_block btrfs: fix rw device counting in __btrfs_free_extra_devids btrfs: fix lost inode on log replay after mix of fsync, rename and inode eviction btrfs: mark compressed range uptodate only if all bio succeed
2 parents 8723bc8 + 7280305 commit 051df24

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

fs/btrfs/compression.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static void end_compressed_bio_write(struct bio *bio)
352352
btrfs_record_physical_zoned(inode, cb->start, bio);
353353
btrfs_writepage_endio_finish_ordered(BTRFS_I(inode), NULL,
354354
cb->start, cb->start + cb->len - 1,
355-
bio->bi_status == BLK_STS_OK);
355+
!cb->errors);
356356

357357
end_compressed_writeback(inode, cb);
358358
/* note, our inode could be gone now */

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb,
209209
static void csum_tree_block(struct extent_buffer *buf, u8 *result)
210210
{
211211
struct btrfs_fs_info *fs_info = buf->fs_info;
212-
const int num_pages = fs_info->nodesize >> PAGE_SHIFT;
212+
const int num_pages = num_extent_pages(buf);
213213
const int first_page_part = min_t(u32, PAGE_SIZE, fs_info->nodesize);
214214
SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
215215
char *kaddr;

fs/btrfs/tree-log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6503,8 +6503,8 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans,
65036503
* if this inode hasn't been logged and directory we're renaming it
65046504
* from hasn't been logged, we don't need to log it
65056505
*/
6506-
if (inode->logged_trans < trans->transid &&
6507-
(!old_dir || old_dir->logged_trans < trans->transid))
6506+
if (!inode_logged(trans, inode) &&
6507+
(!old_dir || !inode_logged(trans, old_dir)))
65086508
return;
65096509

65106510
/*

fs/btrfs/volumes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,7 @@ static void __btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices,
10781078
if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) {
10791079
list_del_init(&device->dev_alloc_list);
10801080
clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
1081+
fs_devices->rw_devices--;
10811082
}
10821083
list_del_init(&device->dev_list);
10831084
fs_devices->num_devices--;

0 commit comments

Comments
 (0)