From 244b2c5ca8b14627e4a17755e5922221e121c771 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 09 Oct 2024 06:15:07 +0000 Subject: [PATCH] change system file --- kernel/fs/nilfs2/sufile.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/kernel/fs/nilfs2/sufile.c b/kernel/fs/nilfs2/sufile.c index 51f4cb0..b3abe69 100644 --- a/kernel/fs/nilfs2/sufile.c +++ b/kernel/fs/nilfs2/sufile.c @@ -779,6 +779,15 @@ goto out_header; sui->ncleansegs -= nsegs - newnsegs; + + /* + * If the sufile is successfully truncated, immediately adjust + * the segment allocation space while locking the semaphore + * "mi_sem" so that nilfs_sufile_alloc() never allocates + * segments in the truncated space. + */ + sui->allocmax = newnsegs - 1; + sui->allocmin = 0; } kaddr = kmap_atomic(header_bh->b_page); -- Gitblit v1.6.2