Patch "btrfs: don't warn if discard range is not aligned to sector" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    btrfs: don't warn if discard range is not aligned to sector

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From a208b3f132b48e1f94f620024e66fea635925877 Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba@xxxxxxxx>
Date: Mon, 15 Jan 2024 20:30:26 +0100
Subject: btrfs: don't warn if discard range is not aligned to sector

From: David Sterba <dsterba@xxxxxxxx>

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@xxxxxxxxxxxxxxx # 4.19+
Reported-by: syzbot+4a4f1eba14eb5c3417d1@xxxxxxxxxxxxxxxxxxxxxxxxx
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>
Signed-off-by: David Sterba <dsterba@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/btrfs/extent-tree.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1209,7 +1209,8 @@ static int btrfs_issue_discard(struct bl
 	u64 bytes_left, end;
 	u64 aligned_start = ALIGN(start, 1 << 9);
 
-	if (WARN_ON(start != aligned_start)) {
+	/* Adjust the range to be aligned to 512B sectors if necessary. */
+	if (start != aligned_start) {
 		len -= aligned_start - start;
 		len = round_down(len, 1 << 9);
 		start = aligned_start;


Patches currently in stable-queue which might be from dsterba@xxxxxxxx are

queue-6.1/btrfs-refresh-dir-last-index-during-a-rewinddir-3-call.patch
queue-6.1/btrfs-fix-race-between-reading-a-directory-and-adding-entries-to-it.patch
queue-6.1/btrfs-tree-checker-fix-inline-ref-size-in-error-messages.patch
queue-6.1/btrfs-sysfs-validate-scrub_speed_max-value.patch
queue-6.1/btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch
queue-6.1/btrfs-don-t-abort-filesystem-when-attempting-to-snapshot-deleted-subvolume.patch
queue-6.1/btrfs-avoid-copying-btrfs_root_subvol_dead-flag-to-snapshot-of-subvolume-being-deleted.patch
queue-6.1/btrfs-ref-verify-free-ref-cache-before-clearing-mount-opt.patch
queue-6.1/btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch
queue-6.1/btrfs-fix-infinite-directory-reads.patch
queue-6.1/btrfs-set-last-dir-index-to-the-current-last-index-when-opening-dir.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux