Patch "f2fs: fix normal discard process" has been added to the 5.4-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

    f2fs: fix normal discard process

to the 5.4-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:
     f2fs-fix-normal-discard-process.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 4202a8a426958d2c9712203d180f2c7193624f2d
Author: Dongdong Zhang <zhangdongdong1@xxxxxxxx>
Date:   Tue Oct 25 17:40:36 2022 +0800

    f2fs: fix normal discard process
    
    [ Upstream commit b5f1a218ae5e4339130d6e733f0e63d623e09a2c ]
    
    In the DPOLICY_BG mode, there is a conflict between
    the two conditions "i + 1 < dpolicy->granularity" and
    "i < DEFAULT_DISCARD_GRANULARITY". If i = 15, the first
    condition is false, it will enter the second condition
    and dispatch all small granularity discards in function
     __issue_discard_cmd_orderly. The restrictive effect
    of the first condition to small discards will be
    invalidated. These two conditions should align.
    
    Fixes: 20ee4382322c ("f2fs: issue small discard by LBA order")
    Signed-off-by: Dongdong Zhang <zhangdongdong1@xxxxxxxx>
    Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
    Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 7759323bd775..e43b57755a7f 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1486,7 +1486,7 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
 		if (i + 1 < dpolicy->granularity)
 			break;
 
-		if (i < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered)
+		if (i + 1 < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered)
 			return __issue_discard_cmd_orderly(sbi, dpolicy);
 
 		pend_list = &dcc->pend_list[i];



[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