Merge 8ac91e6c60 ("Merge tag 'for-5.13-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux") into android-mainline

Steps on the way to 5.13-rc3

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I7f8422f9a1b28c26f70a6a8d3f3a9a7202f39854
This commit is contained in:
Greg Kroah-Hartman
2021-05-25 11:02:55 +02:00
4 changed files with 26 additions and 2 deletions

View File

@@ -5196,7 +5196,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len)
{
int ret = 0;
u64 off = start;
u64 off;
u64 max = start + len;
u32 flags = 0;
u32 found_type;
@@ -5231,6 +5231,11 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
goto out_free_ulist;
}
/*
* We can't initialize that to 'start' as this could miss extents due
* to extent item merging
*/
off = 0;
start = round_down(start, btrfs_inode_sectorsize(inode));
len = round_up(max, btrfs_inode_sectorsize(inode)) - start;

View File

@@ -3241,6 +3241,7 @@ void btrfs_run_delayed_iputs(struct btrfs_fs_info *fs_info)
inode = list_first_entry(&fs_info->delayed_iputs,
struct btrfs_inode, delayed_iput);
run_delayed_iput_locked(fs_info, inode);
cond_resched_lock(&fs_info->delayed_iput_lock);
}
spin_unlock(&fs_info->delayed_iput_lock);
}

View File

@@ -6463,6 +6463,24 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans,
(!old_dir || old_dir->logged_trans < trans->transid))
return;
/*
* If we are doing a rename (old_dir is not NULL) from a directory that
* was previously logged, make sure the next log attempt on the directory
* is not skipped and logs the inode again. This is because the log may
* not currently be authoritative for a range including the old
* BTRFS_DIR_ITEM_KEY and BTRFS_DIR_INDEX_KEY keys, so we want to make
* sure after a log replay we do not end up with both the new and old
* dentries around (in case the inode is a directory we would have a
* directory with two hard links and 2 inode references for different
* parents). The next log attempt of old_dir will happen at
* btrfs_log_all_parents(), called through btrfs_log_inode_parent()
* below, because we have previously set inode->last_unlink_trans to the
* current transaction ID, either here or at btrfs_record_unlink_dir() in
* case inode is a directory.
*/
if (old_dir)
old_dir->logged_trans = 0;
btrfs_init_log_ctx(&ctx, &inode->vfs_inode);
ctx.logging_new_name = true;
/*

View File

@@ -1459,7 +1459,7 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
/* Given hole range was invalid (outside of device) */
if (ret == -ERANGE) {
*hole_start += *hole_size;
*hole_size = false;
*hole_size = 0;
return true;
}