OSDN Git Service

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)
commit5b3dc19dda6691e8ab574e8eede1aef6f02a4f1c
treee841a42971281b482a7a9751f9a22d5af9e82d4e
parent70022da804f0f3f152115688885608c39182082e
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: 07b5b8e1ac40 ("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