Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: fix comment in alloc_bitmap() and drop stale TODO

All callers of alloc_bitmap() hold a transaction handle, so GFP_NOFS is
needed to avoid deadlocks on recursion. Update the comment and drop the
stale TODO.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Rajeev Tapadia <rtapadia730@gmail.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Rajeev Tapadia and committed by
David Sterba
745483ea 725e4629

+3 -5
+3 -5
fs/btrfs/free-space-tree.c
··· 165 165 166 166 /* 167 167 * GFP_NOFS doesn't work with kvmalloc(), but we really can't recurse 168 - * into the filesystem as the free space bitmap can be modified in the 169 - * critical section of a transaction commit. 170 - * 171 - * TODO: push the memalloc_nofs_{save,restore}() to the caller where we 172 - * know that recursion is unsafe. 168 + * into the filesystem here. All callers hold a transaction handle 169 + * open, so if a GFP_KERNEL allocation recurses into the filesystem 170 + * and triggers a transaction commit, we would deadlock. 173 171 */ 174 172 nofs_flag = memalloc_nofs_save(); 175 173 ret = kvzalloc(bitmap_rounded_size, GFP_KERNEL);