]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: discard preallocations before releasing group lock
authorJan Kara <jack@suse.cz>
Thu, 24 Sep 2020 15:09:59 +0000 (17:09 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Oct 2020 14:36:12 +0000 (10:36 -0400)
commitc51d6d5d33120d22bc179a7bbe0b3e7054d41cbb
treee841a42971281b482a7a9751f9a22d5af9e82d4e
parent82b125fb92f3d453f3383f8b8e0e5b1ac1d34f38
ext4: discard preallocations before releasing group lock

ext4_mb_discard_group_preallocations() can be releasing group lock with
preallocations accumulated on its local list. Thus although
discard_pa_seq was incremented and concurrent allocating processes will
be retrying allocations, it can happen that premature ENOSPC error is
returned because blocks used for preallocations are not available for
reuse yet. Make sure we always free locally accumulated preallocations
before releasing group lock.

Fixes: bb536d74b89e ("ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200924150959.4335-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c