aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorXiyu Yang <[email protected]>2020-04-23 05:09:27 +0000
committerTheodore Ts'o <[email protected]>2020-06-04 03:16:49 +0000
commit3bbd0ef26098d241dc59ee77ba14b7dab0df0786 (patch)
treec814fdd1ca7e627a43f182703f949a741014d8a7 /fs/fs-writeback.c
parentext4: fix EXT_MAX_EXTENT/INDEX to check for zeroed eh_max (diff)
downloadkernel-3bbd0ef26098d241dc59ee77ba14b7dab0df0786.tar.gz
kernel-3bbd0ef26098d241dc59ee77ba14b7dab0df0786.zip
ext4: fix buffer_head refcnt leak when ext4_iget() fails
ext4_orphan_get() invokes ext4_read_inode_bitmap(), which returns a reference of the specified buffer_head object to "bitmap_bh" with increased refcnt. When ext4_orphan_get() returns, local variable "bitmap_bh" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of ext4_orphan_get(). When ext4_iget() fails, the function forgets to decrease the refcnt increased by ext4_read_inode_bitmap(), causing a refcnt leak. Fix this issue by calling brelse() when ext4_iget() fails. Signed-off-by: Xiyu Yang <[email protected]> Signed-off-by: Xin Tan <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'fs/fs-writeback.c')
0 files changed, 0 insertions, 0 deletions