]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown
authorBrian Foster <bfoster@redhat.com>
Wed, 2 Aug 2017 17:27:23 +0000 (14:27 -0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 11 Aug 2017 14:29:38 +0000 (16:29 +0200)
commit9cb6634235a1b638458359978073b7bd59e3b3a8
treea0ade9179c0ef48026872c25b9341d452c75d92f
parent88d6661c3a8001f21b696feb9f9c56b7bcbf155c
xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown

BugLink: https://bugs.launchpad.net/bugs/1706132
If the filesystem has shut down, xfs_end_io() currently sets an
error on the ioend and proceeds to ioend destruction. The ioend
might contain a truncate transaction if the I/O extended the size of
the file. This transaction is only cleaned up in
xfs_setfilesize_ioend(), however, which is skipped in this case.
This results in an xfs_log_ticket leak message when the associate
cache slab is destroyed (e.g., on rmmod).

This was originally reproduced by xfs/141 on a distro kernel. The
problem is reproducible on an upstream kernel, but not easily
detected in current upstream if the xfs_log_ticket cache happens to
be merged with another cache. This can be reproduced more
deterministically with the 'slab_nomerge' kernel boot option.

Update xfs_end_io() to proceed with normal end I/O processing after
an error is set on an ioend due to fs shutdown. The I/O type-based
processing is already designed to handle an I/O error and ensure
that the ioend is cleaned up correctly.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit af055e37a91d215d7174d0b84c86795ca81086a7)
Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/xfs/xfs_aops.c