Remove btrfs module after a failed fallocate attempt will cause error on 4.4 i386
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Andrea Righi |
Bug Description
SRU Justification:
[Impact]
* If fallocate() is failing on a btrfs subvolume when its qgroup quota limit exceeded, a previously allocated extent map isn't correctly released, causing a memory leak from the pool btrfs_extent_map.
* Fix by correctly deallocating the object in case of failure
[Test Case]
[Fix]
Fix the memory leak by adding the proper free_extent_map() call to the failure path.
[Regression Potential]
* This is an upstream fix, tested on the affected platform. The patch is really small, backport changes are minimal. All the other Ubuntu releases are including this fix already.
[Original bug report]
If one issues a rmmod (or modprobe -r) command after a failed fallocate attempt, it will cause error with call trace:
======
BUG btrfs_extent_map (Not tainted): Objects remaining in btrfs_extent_map on kmem_cache_close()
------
Disabling lock debugging due to kernel taint
INFO: Slab 0xf7526fb0 objects=34 used=1 fp=0xf43fef78 flags=0x2800080
CPU: 1 PID: 1608 Comm: rmmod Tainted: G B 4.4.0-143-generic #169-Ubuntu
Hardware name: Dell Inc. PowerEdge R310/05XKKK, BIOS 1.11.0 09/18/2012
c1b0d967 35a7d73c 00000286 f4ed9ddc c13c034f f7526fb0 f4ed9dfc f4ed9e70
c11ccc42 c1a164b0 f7526fb0 00000022 00000001 f43fef78 02800080 656a624f
20737463 616d6572 6e696e69 6e692067 72746220 655f7366 6e657478 616d5f74
Call Trace:
[<c13c034f>] dump_stack+
[<c11ccc42>] slab_err+0x82/0xa0
[<c11d090d>] ? __kmalloc+
[<c11ce550>] ? __free_
[<c11d0ba9>] ? free_partial+
[<c11d0ba9>] ? free_partial+
[<c11d0bce>] free_partial+
[<c11cf350>] ? __flush_
[<c11d24e2>] __kmem_
[<c119e5e2>] kmem_cache_
[<f8dc0ac6>] extent_
[<f8e2ee20>] exit_btrfs_
[<c10fd19f>] SyS_delete_
[<c11edbad>] ? ____fput+0xd/0x10
[<c109062f>] ? task_work_
[<c10031f6>] ? exit_to_
[<c10038af>] do_fast_
[<c17e63f0>] sysenter_
INFO: Object 0xf43fe078 @offset=120
kmem_cache_destroy btrfs_extent_map: Slab cache still has objects
CPU: 1 PID: 1608 Comm: rmmod Tainted: G B 4.4.0-143-generic #169-Ubuntu
Hardware name: Dell Inc. PowerEdge R310/05XKKK, BIOS 1.11.0 09/18/2012
c1b0d967 35a7d73c 00000286 f4ed9ed4 c13c034f ef34f600 ef34f674 f4ed9f0c
c119e630 c1a14d18 f55f3220 f4ed9f04 000d96ab f4ed9eec f4ed9eec f4ed9ef4
f4ed9ef4 35a7d73c 022ffd44 f8e46880 f4ed8000 f4ed9f14 f8dc0ac6 f4ed9f1c
Call Trace:
[<c13c034f>] dump_stack+
[<c119e630>] kmem_cache_
[<f8dc0ac6>] extent_
[<f8e2ee20>] exit_btrfs_
[<c10fd19f>] SyS_delete_
[<c11edbad>] ? ____fput+0xd/0x10
[<c109062f>] ? task_work_
[<c10031f6>] ? exit_to_
[<c10038af>] do_fast_
[<c17e63f0>] sysenter_
Steps to reproduce this:
TMP=/tmp
MNT=/tmp/mnt
mkdir $MNT
TMPIMG0=
DEV0=`losetup -f`
truncate --size 512M $TMPIMG0
losetup $DEV0 $TMPIMG0
mkfs.btrfs -f $DEV0 >& /dev/null
mount $DEV0 $MNT
btrfs quota enable $MNT
btrfs sub create $MNT/subv
btrfs qgroup limit 10M $MNT/subv
fallocate --length 20M $MNT/subv/data
rmmod btrfs
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-143-generic i686
AlsaDevices:
total 0
crw-rw---- 1 root audio 116, 1 Apr 1 11:43 seq
crw-rw---- 1 root audio 116, 33 Apr 1 11:43 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: i386
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Date: Mon Apr 1 11:55:56 2019
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
MachineType: Dell Inc. PowerEdge R310
PciMultimedia:
ProcFB:
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
linux-
linux-
linux-firmware 1.157.21
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/18/2012
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.11.0
dmi.board.name: 05XKKK
dmi.board.vendor: Dell Inc.
dmi.board.version: A05
dmi.chassis.type: 23
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.
dmi.product.name: PowerEdge R310
dmi.sys.vendor: Dell Inc.
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Andrea Righi (arighi) |
assignee: | Andrea Righi (arighi) → nobody |
Changed in linux (Ubuntu Xenial): | |
assignee: | nobody → Andrea Righi (arighi) |
description: | updated |
tags: | added: patch |
Changed in linux (Ubuntu Xenial): | |
status: | Confirmed → Fix Committed |
tags: |
added: verification-done-xenial removed: verification-needed-xenial |
Changed in ubuntu-kernel-tests: | |
status: | New → Fix Released |
Changed in linux (Ubuntu): | |
status: | Confirmed → Fix Released |
This change was made by a bot.