btrfs: don't warn if discard range is not aligned to sector
authorDavid Sterba <dsterba@suse.com>
Mon, 15 Jan 2024 19:30:26 +0000 (20:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:06 +0000 (16:19 -0800)
commitbe725b06a4c39cc4e07d1e57c0c2ce64db411ccf
tree5e90a47793ae0321bc520d9d4bf52b33f9a63c59
parentad854a86da1522b959aee8c1065e0b2167bd6a9c
btrfs: don't warn if discard range is not aligned to sector

commit a208b3f132b48e1f94f620024e66fea635925877 upstream.

There's a warning in btrfs_issue_discard() when the range is not aligned
to 512 bytes, originally added in 4d89d377bbb0 ("btrfs:
btrfs_issue_discard ensure offset/length are aligned to sector
boundaries"). We can't do sub-sector writes anyway so the adjustment is
the only thing that we can do and the warning is unnecessary.

CC: stable@vger.kernel.org # 4.19+
Reported-by: syzbot+4a4f1eba14eb5c3417d1@syzkaller.appspotmail.com
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/extent-tree.c