Patch "ubifs: Correct the total block count by deducting journal reservation" 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

    ubifs: Correct the total block count by deducting journal reservation

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:
     ubifs-correct-the-total-block-count-by-deducting-jou.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.



commit d8391257d327fe9113579e20294cca57da98297a
Author: Zhihao Cheng <chengzhihao1@xxxxxxxxxx>
Date:   Thu Sep 5 09:09:09 2024 +0800

    ubifs: Correct the total block count by deducting journal reservation
    
    [ Upstream commit 84a2bee9c49769310efa19601157ef50a1df1267 ]
    
    Since commit e874dcde1cbf ("ubifs: Reserve one leb for each journal
    head while doing budget"), available space is calulated by deducting
    reservation for all journal heads. However, the total block count (
    which is only used by statfs) is not updated yet, which will cause
    the wrong displaying for used space(total - available).
    Fix it by deducting reservation for all journal heads from total
    block count.
    
    Fixes: e874dcde1cbf ("ubifs: Reserve one leb for each journal head while doing budget")
    Signed-off-by: Zhihao Cheng <chengzhihao1@xxxxxxxxxx>
    Signed-off-by: Richard Weinberger <richard@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 32cb147597960..d4c3948a7f863 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -777,10 +777,10 @@ static void init_constants_master(struct ubifs_info *c)
 	 * necessary to report something for the 'statfs()' call.
 	 *
 	 * Subtract the LEB reserved for GC, the LEB which is reserved for
-	 * deletions, minimum LEBs for the index, and assume only one journal
-	 * head is available.
+	 * deletions, minimum LEBs for the index, the LEBs which are reserved
+	 * for each journal head.
 	 */
-	tmp64 = c->main_lebs - 1 - 1 - MIN_INDEX_LEBS - c->jhead_cnt + 1;
+	tmp64 = c->main_lebs - 1 - 1 - MIN_INDEX_LEBS - c->jhead_cnt;
 	tmp64 *= (long long)c->leb_size - c->leb_overhead;
 	tmp64 = ubifs_reported_space(c, tmp64);
 	c->block_cnt = tmp64 >> UBIFS_BLOCK_SHIFT;




[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