fs/block_dev.c is aware of this required module_put() call, but f.e.
blkg_conf_finish(), which is located in block/blk-cgroup.c, does not put
a module reference. To see a leakage in action cgroups throttle config
can be used. In the following script I'm removing throttle for /dev/ram0
(actually this is NOP, because throttle was never set for this device):
> BugLink: http://bugs.launchpad.net/bugs/1683976 >
> == SRU Justification ==
> Due to this bug, the module reference count will leak whenever you write to
> /sys/fs/cgroup/blkio/blkio.throttle.* There is a script in the bug report
> to reproduce the bug.
> Commit 39a169b62b41 resolves this bug and was added to mainline in
> v4.5-rc5. However, it was not cc'd to stable.
> This commit is also needed in Trusty, but needs a minor backport. The Trusty
> SRU will be sent separately.
> == Fix ==
> commit 39a169b62b415390398291080dafe63aec751e0a
> Author: Roman Pen <[hidden email]>
> Date: Tue Feb 9 12:33:35 2016 -0700
> block: fix module reference leak on put_disk() call for cgroups throttle
> == Test Case ==
> A test kernel was built with this patch and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
> Roman Pen (1):
> block: fix module reference leak on put_disk() call for cgroups
> block/blk-cgroup.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Sane looking upstream fix, backport looks good, good test case and good
test results for Xenial.