kernel/fs/nilfs2/sufile.c
.. .. @@ -779,6 +779,15 @@ 779 779 goto out_header; 780 780 781 781 sui->ncleansegs -= nsegs - newnsegs; 782 +783 + /*784 + * If the sufile is successfully truncated, immediately adjust785 + * the segment allocation space while locking the semaphore786 + * "mi_sem" so that nilfs_sufile_alloc() never allocates787 + * segments in the truncated space.788 + */789 + sui->allocmax = newnsegs - 1;790 + sui->allocmin = 0;782 791 } 783 792 784 793 kaddr = kmap_atomic(header_bh->b_page);