diff options
author | Brian Foster <bfoster@redhat.com> | 2015-08-19 10:00:28 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-08-19 10:00:28 +1000 |
commit | 0ae120f8a81a8dc4f974d0819c97b58c4fa935ac (patch) | |
tree | 8e47f78b71cc567985137ddb799800e1e56526ee /firmware | |
parent | a3f20014659a1566a4e516e2bf95287960fe2c44 (diff) | |
download | linux-0ae120f8a81a8dc4f974d0819c97b58c4fa935ac.tar.gz linux-0ae120f8a81a8dc4f974d0819c97b58c4fa935ac.tar.bz2 linux-0ae120f8a81a8dc4f974d0819c97b58c4fa935ac.zip |
xfs: clean up root inode properly on mount failure
The root inode is read as part of the xfs_mountfs() sequence and the
reference is dropped in the event of failure after we grab the
inode. The reference drop doesn't necessarily free the inode,
however. It marks it for reclaim and potentially kicks off the
reclaim workqueue. The workqueue is destroyed further up the error
path, which means we are subject to crash if the workqueue job runs
after this point or a memory leak which is identified if the
xfs_inode_zone is destroyed (e.g., on module removal). Both of these
outcomes are reproducible via manual instrumentation of a mount
error after the root inode xfs_iget() call in xfs_mountfs().
Update the xfs_mountfs() error path to cancel any potential reclaim
work items and to run a synchronous inode reclaim if the root inode
is marked for reclaim. This ensures that no jobs remain on the queue
before it is destroyed and that the root inode is freed before the
reclaim mechanism is torn down.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions