Age | Commit message (Collapse) | Author |
|
Enable the metadata inode directory feature.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Check and repair the free inode btree block counters in the AGI.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Add a free inode btree block usage counter to the AGI header so that we
don't have to walk the entire finobt at mount time to create the per-AG
reservations. We piggyback on the metadir feature bit to avoid burning
extra incompat bits.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Ideally, we'd put all the metadata inodes in one place if we could, so
that the metadata all stay reasonably close together instead of
spreading out over the disk. Furthermore, if the log is internal we'd
probably prefer to keep the metadata near the log. Therefore, disable
AGI rotoring for metadata inode allocations.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Since xfs_imeta_create can create new metadata files arbitrarily deep in
the metadata directory tree, we must supply a function that can ensure
that all directories in a path exist, and call it before the quota
functions create the quota inodes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Plumb in the bits we need to look up metadata inode numbers from the
metadata inode directory and save them back.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Add checks for the metadata inode flag so that we don't ever leak
metadata inodes out to userspace, and we don't ever try to read a
regular inode as metadata.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Convert the magic metadata inode lookup keys to use actual strings
for paths.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Load the metadata directory inode into memory at mount time and release
it at unmount time. We also make sure that the obsolete inode pointers
in the superblock are not logged or read from the superblock.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Define the on-disk layout and feature flags for the metadata inode
directory feature.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a xfs_iget_meta function for metadata inodes to ensure that we
always check that the inobt thinks a metadata inode is in use.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Convert all open-coded sb metadata inode pointer logging to use
xfs_imeta_log.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Refactor the group and project quota inode pointer switcheroo that
happens only on v4 filesystems into a separate function prior to
enhancing the xfs_qm_qino_alloc function.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create transaction reservation types and block reservation helpers to
help us calculate transaction requirements.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create some helper routines to get and set metadata inode numbers
instead of open-coding them throughout xfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Get rid of the largely pointless xfs_cross_rename now that we've
refactored its parent.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a new libxfs function to rename two directory entries. The
upcoming metadata directory feature will need this to replace a metadata
inode directory entry.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a new libxfs function to exchange two directory entries.
The upcoming metadata directory feature will need this to replace a
metadata inode directory entry.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a new libxfs function to remove a (name, inode) entry from a
directory. The upcoming metadata directory feature will need this to
create a metadata directory tree.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a libxfs helper function that marks an inode free on disk.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a new libxfs function to link an existing inode into a directory.
The upcoming metadata directory feature will need this to create a
metadata directory tree.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a new libxfs function to link a newly created inode into a
directory. The upcoming metadata directory feature will need this to
create a metadata directory tree.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move xfs_bumplink and xfs_droplink to libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move xfs_iunlink and xfs_iunlink_remove to libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move xfs_dir_ialloc to libxfs, and make xfs_ialloc static since we only
needed it to be non-static temporarily.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
In xfs_dir_ialloc, we roll the transaction if we had to allocate a new
inode chunk and before we actually initialize the inode. In the kernel
this requires us to detach the transaction's quota charge information
from the ichunk allocation transaction and to attach it the ialloc
transaction because we don't charge quota for inode chunks. This
doesn't exist in the userspace side of things, so pop it out into a
separately called function.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move the initialization of the xfs_ialloc_args structure out of
xfs_dir_ialloc into its callers' callers so that we can set the new
inode's parameters in one place and pass it through instead of open
coding the new uid/gid/prid all over the code. This also prepares us
for moving xfs_dir_ialloc and xfs_create to libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move the inode allocation function into libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a post-allocation iget helper so that the upcoming libxfs hoist
doesn't have to determine the xfs_iget interface.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Split new inode allocation and initialization into separate helpers.
Eventually we'll supply a force-reinitialization function so that
xfs_repair can use libxfs to reset the root directory and friends.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Use xfs_trans_ichgtime to set the inode times when allocating an inode,
instead of open-coding them here.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Enable xfs_trans_ichgtime to change the inode access time so that we can
use this function to set inode times when allocating inodes instead of
open-coding it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Instead of open-coding new inode parameters through xfs_dir_ialloc and
xfs_Ialloc, put everything into a structure and pass that instead. This
will make it easier to share code with xfsprogs while maintaining the
ability for xfsprogs to supply extra new inode parameters.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move the project id get and set functions into libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Hoist the inode flag conversion functions into libxfs so that we can
keep them in sync. Do this by creating a new xfs_inode_utils.c file in
libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Move the extent size helpers to xfs_bmap.c in libxfs since they're used
there already.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Use the same summary counter calculation infrastructure to generate new
values for the in-core summary counters. The difference between the
scrubber and the repairer is that the repairer will freeze the fs during
setup, which means that the values should match exactly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Use the fs freezing mechanism we developed for the rmapbt repair to
freeze the fs, this time to scan the fs for a live quotacheck. We add a
new dqget variant to use the existing scrub transaction to allocate an
on-disk dquot block if it is missing.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Rebuild the reverse mapping btree from all primary metadata.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Use a workqueue thread to call xfile io operations because lockdep
complains when we freeze the filesystem.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Introduce a new 'online scrub freeze' that we can use to lock out all
filesystem modifications and background activity so that we can perform
global scans in order to rebuild metadata. This introduces a new IFLAG
to the scrub ioctl to indicate that userspace is willing to allow a
freeze.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
If scrub finds that everything is ok with the filesystem, we need a way
to tell the health tracking that it can let go of indirect health flags,
since indirect flags only mean that at some point in the past we lost
some context.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
If an unhealthy inode gets inactivated, remember this fact in the
per-fs health summary.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Establish two more classes of health tracking bits:
* Indirect problems, which suggest problems in other health domains
that we weren't able to preserve.
* Secondary problems, which track state that's related to primary
evidence of health problems; and
The first class we'll use in an upcoming patch to record in the AG
health status the fact that we ran out of memory and had to inactivate
an inode with defective metadata. The second class we use to indicate
that repair knows that an inode is bad and we need to fix it later.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create a polled version of xfs_inactive_force so that we can force
inactivation while holding a lock (usually the umount lock) without
tripping over the softlockup timer. This is for callers that hold vfs
locks while calling inactivation, which is currently unmount, iunlink
processing during mount, and rw->ro remount.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Split the inode inactivation work into per-AG work items so that we can
take advantage of parallelization.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
If we think that inactivation will free enough blocks to make it easier
to satisfy an fallocate request, force inactivation.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Any time we try to modify a file's contents and it fails due to ENOSPC
or EDQUOT, force inactivation work to free up some resources and try one
more time.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Instead of calling xfs_inactive directly from xfs_fs_destroy_inode,
defer the inactivation phase to a separate workqueue. With this we
avoid blocking memory reclaim on filesystem metadata updates that are
necessary to free an in-core inode, such as post-eof block freeing, COW
staging extent freeing, and truncating and freeing unlinked inodes. Now
that work is deferred to a workqueue where we can do the freeing in
batches.
We introduce two new inode flags -- NEEDS_INACTIVE and INACTIVATING.
The first flag helps our worker find inodes needing inactivation, and
the second flag marks inodes that are in the process of being
inactivated. A concurrent xfs_iget on the inode can still resurrect the
inode by clearing NEEDS_INACTIVE (or bailing if INACTIVATING is set).
Unfortunately, deferring the inactivation has one huge downside --
eventual consistency. Since all the freeing is deferred to a worker
thread, one can rm a file but the space doesn't come back immediately.
This can cause some odd side effects with quota accounting and statfs,
so we also force inactivation scans in order to maintain the existing
behaviors, at least outwardly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
Create an alternative version of xfs_ici_walk() that allow a caller to
pass in custom inode grab and inode release helper functions. Deferred
inode inactivation deals with xfs inodes that are still in memory but no
longer visible to the vfs, which means that it has to screen and process
those inodes differently.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|