]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/log
thirdparty/xfsprogs-dev.git
6 years agoxfs: fix inobt inode allocation search optimization libxfs-4.13-sync
Omar Sandoval [Fri, 15 Sep 2017 13:32:48 +0000 (08:32 -0500)] 
xfs: fix inobt inode allocation search optimization

Source kernel commit: c44245b3d5435f533ca8346ece65918f84c057f9

When we try to allocate a free inode by searching the inobt, we try to
find the inode nearest the parent inode by searching chunks both left
and right of the chunk containing the parent. As an optimization, we
cache the leftmost and rightmost records that we previously searched; if
we do another allocation with the same parent inode, we'll pick up the
search where it last left off.

There's a bug in the case where we found a free inode to the left of the
parent's chunk: we need to update the cached left and right records, but
because we already reassigned the right record to point to the left, we
end up assigning the left record to both the cached left and right
records.

This isn't a correctness problem strictly, but it can result in the next
allocation rechecking chunks unnecessarily or allocating inodes further
away from the parent than it needs to. Fix it by swapping the record
pointer after we update the cached left and right records.

Fixes: bd169565993b ("xfs: speed up free inode search")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix multi-AG deadlock in xfs_bunmapi
Christoph Hellwig [Mon, 31 Jul 2017 20:08:13 +0000 (15:08 -0500)] 
xfs: fix multi-AG deadlock in xfs_bunmapi

Source kernel commit: 5b094d6dac0451ad89b1dc088395c7b399b7e9e8

Just like in the allocator we must avoid touching multiple AGs out of
order when freeing blocks, as freeing still locks the AGF and can cause
the same AB-BA deadlocks as in the allocation path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: check that dir block entries don't off the end of the buffer
Darrick J. Wong [Mon, 31 Jul 2017 20:08:13 +0000 (15:08 -0500)] 
xfs: check that dir block entries don't off the end of the buffer

Source kernel commit: 6215894e11de224183c89b001f5363912442b489

When we're checking the entries in a directory buffer, make sure that
the entry length doesn't push us off the end of the buffer.  Found via
xfs/388 writing ones to the length fields.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: check _alloc_read_agf buffer pointer before using
Darrick J. Wong [Mon, 31 Jul 2017 20:08:13 +0000 (15:08 -0500)] 
xfs: check _alloc_read_agf buffer pointer before using

Source kernel commit: 10479e2dea83d4c421ad05dfc55d918aa8dfc0cd

In some circumstances, _alloc_read_agf can return an error code of zero
but also a null AGF buffer pointer.  Check for this and jump out.

Fixes-coverity-id: 1415250
Fixes-coverity-id: 1415320
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write
Darrick J. Wong [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write

Source kernel commit: 4c1a67bd3606540b9b42caff34a1d5cd94b1cf65

We must initialize the firstfsb parameter to _bmapi_write so that it
doesn't incorrectly treat stack garbage as a restriction on which AGs
it can search for free space.

Fixes-coverity-id: 1402025
Fixes-coverity-id: 1415167
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: check _btree_check_block value
Darrick J. Wong [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: check _btree_check_block value

Source kernel commit: 1e86eabe73b73c82e1110c746ed3ec6d5e1c0a0d

Check the _btree_check_block return value for the firstrec and lastrec
functions, since we have the ability to signal that the repositioning
did not succeed.

Fixes-coverity-id: 114067
Fixes-coverity-id: 114068
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoRevert "xfs: grab dquots without taking the ilock"
Christoph Hellwig [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
Revert "xfs: grab dquots without taking the ilock"

Source kernel commit: 0891f9971a3b00d243d5743cc78a628ad060adea

This reverts commit cfcce6478cee639b15cd50e68cf66f884e137312.

The new XFS_QMOPT_NOLOCK isn't used at all, and conditional locking based
on a flag is always the wrong thing to do - we should be having helpers
that can be called without the lock instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fixup xfs_attr_get_ilocked
Christoph Hellwig [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: fixup xfs_attr_get_ilocked

Source kernel commit: cf69f8248cc89c0a0e82f8332f9e7f13ab014c98

The comment mentioned the wrong lock.  Also add an ASSERT to assert
this locking precondition.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: don't crash on unexpected holes in dir/attr btrees
Darrick J. Wong [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: don't crash on unexpected holes in dir/attr btrees

Source kernel commit: cd87d867920155911d0d2e6485b769d853547750

In quite a few places we call xfs_da_read_buf with a mappedbno that we
don't control, then assume that the function passes back either an error
code or a buffer pointer.  Unfortunately, if mappedbno == -2 and bno
maps to a hole, we get a return code of zero and a NULL buffer, which
means that we crash if we actually try to use that buffer pointer.  This
happens immediately when we set the buffer type for transaction context.

Therefore, check that we have no error code and a non-NULL bp before
trying to use bp.  This patch is a follow-up to an incomplete fix in
96a3aefb8ffde231 ("xfs: don't crash if reading a directory results in an
unexpected hole").

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: rename MAXPATHLEN to XFS_SYMLINK_MAXLEN
Darrick J. Wong [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: rename MAXPATHLEN to XFS_SYMLINK_MAXLEN

Source kernel commit: 6eb0b8df9f74f33d1a69100117630a7a87a9cc96

XFS has a maximum symlink target length of 1024 bytes; this is a
holdover from the Irix days.  Unfortunately, the constant establishing
this is 'MAXPATHLEN' and is /not/ the same as the Linux MAXPATHLEN,
which is 4096.

The kernel enforces its 1024 byte MAXPATHLEN on symlink targets, but
xfsprogs picks up the (Linux) system 4096 byte MAXPATHLEN, which means
that xfs_repair doesn't complain about oversized symlinks.

Since this is an on-disk format constraint, put the define in the XFS
namespace and move everything over to use the new name.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: grab dquots without taking the ilock
Darrick J. Wong [Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)] 
xfs: grab dquots without taking the ilock

Source kernel commit: 50e0bdbe9f48f98bb02eac7030d682f4716884ae

Add a new dqget flag that grabs the dquot without taking the ilock.
This will be used by the scrubber (which will have already grabbed
the ilock) to perform basic sanity checking of the quota data.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove unneeded parameter from XFS_TEST_ERROR
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: remove unneeded parameter from XFS_TEST_ERROR

Source kernel commit: 9e24cfd044853e0e46e7149b91b7bb09effb0a79

Since we moved the injected error frequency controls to the mountpoint,
we can get rid of the last argument to XFS_TEST_ERROR.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: pass along transaction context when reading xattr block buffers
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: pass along transaction context when reading xattr block buffers

Source kernel commit: ad017f6537dee30a67b89f937a16e2f6c82e3774

Teach the extended attribute reading functions to pass along a
transaction context if one was supplied.  The extended attribute scrub
code will use transactions to lock buffers and avoid deadlocking with
itself in the case of loops; since it will already have the inode
locked, also create xattr get/list helpers that don't take locks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: pass along transaction context when reading directory block buffers
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: pass along transaction context when reading directory block buffers

Source kernel commit: acb9553cab552cf17154814f079f54401eefa474

Teach the directory reading functions to pass along a transaction context
if one was supplied.  The directory scrub code will use transactions to
lock buffers and avoid deadlocking with itself in the case of loops.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: return the hash value of a leaf1 directory block
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: return the hash value of a leaf1 directory block

Source kernel commit: 8e8877e6edf2b593fe488b6efa8b3b7cfba96738

Modify the existing dir leafn lasthash function to enable us to
calculate the highest hash value of a leaf1 block.  This will be used by
the directory scrubbing code to check the sanity of hashes in leaf1
directory blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: export _inobt_btrec_to_irec and _ialloc_cluster_alignment for scrub
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: export _inobt_btrec_to_irec and _ialloc_cluster_alignment for scrub

Source kernel commit: e936945ee49693f40217db82a7db55c94e34ce4c

Create a function to extract an in-core inobt record from a generic
btree_rec union so that scrub will be able to check inobt records
and check inode block alignment.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: plumb in needed functions for range querying of various btrees
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: plumb in needed functions for range querying of various btrees

Source kernel commit: 118bb47e281cde728608633f1a358fb9f2ac0adc

Plumb in the pieces (init_high_key, diff_two_keys) necessary to call
query_range on the inode space and block mapping btrees and to extract
raw btree records.  This will eventually be used by the inobt and bmbt
scrubbers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: export various function for the online scrubber
Darrick J. Wong [Mon, 31 Jul 2017 20:08:11 +0000 (15:08 -0500)] 
xfs: export various function for the online scrubber

Source kernel commit: 2678809799e6e37db0800725157f5ebfc03a9df7

Export various internal functions so that the online scrubber can use
them to check the state of metadata.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: always compile the btree inorder check functions
Darrick J. Wong [Mon, 31 Jul 2017 20:08:10 +0000 (15:08 -0500)] 
xfs: always compile the btree inorder check functions

Source kernel commit: 38dee376d67047e9877a34e408013852c9729eb8

The btree record and key inorder check functions will be used by the
btree scrubber code, so make sure they're always built.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove double-underscore integer types
Darrick J. Wong [Mon, 31 Jul 2017 20:08:10 +0000 (15:08 -0500)] 
xfs: remove double-underscore integer types

Source kernel commit: c8ce540db5f67d254aafb14b5d76422c62a906df

This is a purely mechanical patch that removes the private
__{u,}int{8,16,32,64}_t typedefs in favor of using the system
{u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
the transformation and fix the resulting whitespace and indentation
errors:

s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: optimize _btree_query_all
Darrick J. Wong [Mon, 31 Jul 2017 20:08:10 +0000 (15:08 -0500)] 
xfs: optimize _btree_query_all

Source kernel commit: 5a4c73342ad493c61f19a1406f47dcd35e18030f

Don't bother wandering our way through the leaf nodes when the caller
issues a query_all; just zoom down the left side of the tree and walk
rightwards along level zero.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove XFS_HSIZE
Christoph Hellwig [Mon, 31 Jul 2017 20:08:10 +0000 (15:08 -0500)] 
xfs: remove XFS_HSIZE

Source kernel commit: 3398a4005f0c8ced67a9071475562d435d88b7a6

XFS_HSIZE is an extremly confusing way to calculate the size of handle_t.
Given that handle_t always only had two sizes, and one of them isn't
even covered by XFS_HSIZE to start with just remove the macro and use
a constant sizeof expression.

Note that XFS_HSIZE isn't used in xfsprogs, xfsdump or xfstests either.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: try to avoid blowing out the transaction reservation when bunmaping a shared...
Darrick J. Wong [Mon, 31 Jul 2017 20:08:09 +0000 (15:08 -0500)] 
xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent

Source kernel commit: e1a4e37cc7b665b6804fba812aca2f4d7402c249

In a pathological scenario where we are trying to bunmapi a single
extent in which every other block is shared, it's possible that trying
to unmap the entire large extent in a single transaction can generate so
many EFIs that we overflow the transaction reservation.

Therefore, use a heuristic to guess at the number of blocks we can
safely unmap from a reflink file's data fork in an single transaction.
This should prevent problems such as the log head slamming into the tail
and ASSERTs that trigger because we've exceeded the transaction
reservation.

Note that since bunmapi can fail to unmap the entire range, we must also
teach the deferred unmap code to roll into a new transaction whenever we
get low on reservation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[hch: random edits, all bugs are my fault]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfsprogs: Release v4.12.0 v4.12.0
Eric Sandeen [Thu, 20 Jul 2017 15:57:14 +0000 (10:57 -0500)] 
xfsprogs: Release v4.12.0

Update all the necessary files for a 4.12.0 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agolibxfs: propagate transaction block reservations
Darrick J. Wong [Thu, 20 Jul 2017 15:51:46 +0000 (10:51 -0500)] 
libxfs: propagate transaction block reservations

Certain parts of the libxfs preemptively refuse to run if the
transaction block reservation has fallen to zero.  We leave t_blk_res at
its default of zero, which means that these code paths always fail even
if the transaction was allocated with a non-zero block reservation.  Set
t_blk_res and maintain it through transaction rolls, even though we
don't do much enforcement the transaction block limits.

[sandeen: This broke during a libxfs sync to userspace, see Fixes:]

Fixes: 0268fdc3 ("xfs: remove xfs_trans_get_block_res")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: properly set inode type
Eric Sandeen [Thu, 20 Jul 2017 15:51:46 +0000 (10:51 -0500)] 
xfs_db: properly set inode type

When we set the type to "inode" the verifier validates multiple
inodes in the current fs block, so setting the buffer size to
that of just one inode is not sufficient and it'll emit spurious
verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200
Metadata corruption detected at xfs_inode block 0x63/0x200

Use the special set_cur_inode() function for this purpose
as is done in inode_f().

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
[sandeen: remove nag/warning printf for now]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: redirect printfs when metadumping to stdout
Darrick J. Wong [Thu, 20 Jul 2017 15:51:37 +0000 (10:51 -0500)] 
xfs_db: redirect printfs when metadumping to stdout

If we're metadumping to stdout, we don't want xfs_db's various dbprintf
statements dumping to stdout because that'll corrupt the metadump.
Therefore, let outf point to the existing stdout and redirect stdout to
stderr for the duration of the dump operation.

Reported-by: David Shaw <dshaw@jabberwocky.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agomkfs.xfs: allow specification of 0 data stripe width & unit
Eric Sandeen [Thu, 20 Jul 2017 15:51:34 +0000 (10:51 -0500)] 
mkfs.xfs: allow specification of 0 data stripe width & unit

The "noalign" option works for this too, but it seems reasonable
to allow explicit specification of stripe unit and stripe width
to 0; today, doing so today makes the code think it's unspecified,
and so it goes ahead and detects stripe geometry and sets it in the
superblock.  That's unexpected and surprising.

Create a new flag that tracks whtether a geometry option has been
specified, and if it's set along with 0 values, treat it the
same as if "noalign" had been specified.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfsprogs: Release v4.12.0-rc2 v4.12.0-rc2
Eric Sandeen [Thu, 13 Jul 2017 18:53:31 +0000 (13:53 -0500)] 
xfsprogs: Release v4.12.0-rc2

Update all the necessary files for a 4.12.0-rc2 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agomkfs: set inode alignment and cluster size for minimum log size estimation
Darrick J. Wong [Thu, 13 Jul 2017 16:51:27 +0000 (11:51 -0500)] 
mkfs: set inode alignment and cluster size for minimum log size estimation

In order for mkfs to calculate the minimum log size correctly, it must
be able to find the transaction type with the largest reservation.  The
iunlink transaction reservation size calculation depends on having the
inode cluster size set correctly, which in turn depends on the inode
alignment parameters being set as they will be in the final filesystem.
Therefore we have to set up the inoalignmt field in max_trans_res.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agomkfs: set agblklog when we're verifying minimum log size
Darrick J. Wong [Thu, 13 Jul 2017 16:51:25 +0000 (11:51 -0500)] 
mkfs: set agblklog when we're verifying minimum log size

In e5cc9d560a ("mkfs: set agsize prior to calculating minimum log
size"), we set the ag size in the superblock structure so that we can
calculate the maximum btree height correctly.  The btree heights are
used to calculate transaction reservation sizes; these sizes are used to
compute the minimum log length; and the minimum log length is checked by
the kernel.

Unfortunately, I didn't realize that some of the btree sizing functions
also depend on the agblklog (log2 of the ag size), so we've been
underestimating the minimum log length allowable, which results in mkfs
formatting filesystems that the kernel refuses to mount.

This can be trivially reproduced by formatting a small (~800M) volume
with rmap and reflink turned on.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfsprogs: Release v4.12.0-rc1 v4.12.0-rc1
Eric Sandeen [Fri, 30 Jun 2017 19:30:32 +0000 (14:30 -0500)] 
xfsprogs: Release v4.12.0-rc1

Update all the necessary files for a 4.12.0-rc1 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agolibxfs: fix fsmap.h inclusion
Darrick J. Wong [Fri, 30 Jun 2017 18:56:29 +0000 (13:56 -0500)] 
libxfs: fix fsmap.h inclusion

If we /do/ have HAVE_GETFSMAP defined, we need to include linux/fsmap.h.

Found-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: identify attr dabtree field types correctly
Darrick J. Wong [Fri, 30 Jun 2017 16:02:46 +0000 (11:02 -0500)] 
xfs_db: identify attr dabtree field types correctly

For whatever reason, the v5 xattr dabtree header fields are mapped to
the directory dabtree header fields, which means that the types are
wrong and hence we cannot use the 'addr' command to step through the
tree.  Since the v4 attr dabtree does this correctly, simply port the v5
fields to the attr code too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: fix potential overflowing expression in trim_f()
Bill O'Donnell [Thu, 29 Jun 2017 18:05:59 +0000 (13:05 -0500)] 
xfs_spaceman: fix potential overflowing expression in trim_f()

Prevent the potential overflow in expression calculating offset
in trim_f(() by casting the first variable to off64_t (64bit signed).

Addresses-Coverity-Id: 1413771

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: close open file for error case in openfile()
Bill O'Donnell [Thu, 29 Jun 2017 18:05:58 +0000 (13:05 -0500)] 
xfs_spaceman: close open file for error case in openfile()

openfile() fails to close the open file in one error case.
Add close(fd) to correct the condition.

Addresses-Coverity-Id: 1413770

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: fix potential memory leak by malloc in scan_ag
Bill O'Donnell [Thu, 29 Jun 2017 18:05:41 +0000 (13:05 -0500)] 
xfs_spaceman: fix potential memory leak by malloc in scan_ag

scan_ag mallocs memory that is potentially leaked. Add a free
to alleviate the potential leak.

Addresses-Coverity-Id: 1413772

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: improve argument naming in set_cur and set_iocur_type
Bill O'Donnell [Thu, 29 Jun 2017 18:05:00 +0000 (13:05 -0500)] 
xfs_db: improve argument naming in set_cur and set_iocur_type

In set_cur and set_iocur_type, the current naming for arguments
type, block number, and length are t, d, and c, respectively.
Replace these with more intuitive and descriptive names:
type, blknum, and len. Fix type of blknum (xfs_daddr_t) to be
consistent with that of libxfs_readbuf where it's used.
Additionally remove extra blank line in io.c.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: update buffer size when new type is set
Bill O'Donnell [Thu, 29 Jun 2017 18:05:00 +0000 (13:05 -0500)] 
xfs_db: update buffer size when new type is set

xfs_db doesn't take sector size into account when setting type.
This can result in an errant crc. For example, with a sector size
of 4096:

xfs_db> agi 0
xfs_db> p crc
crc = 0xab85043e (correct)
xfs_db> daddr
current daddr is 16
xfs_db> daddr 42
xfs_db> daddr 16
xfs_db> type agi
Metadata CRC error detected at xfs_agi block 0x10/0x200
xfs_db> p crc
crc = 0xab85043e (bad)

When xfs_db sets the new daddr in daddr_f, it does so with one
BBSIZE sector (512). Changing the type doesn't change the size
of the current buffer in iocur_top, so the checksum is calculated
on the wrong length for the type (when the actual sector size > BBSIZE (512).

For types with fields, reread the buffer to pick up the correct size for
the new type when it gets set. Facilitate the reread by setting the cursor
with set_cur().

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[sandeen: fix up long line, clarify subject & comments]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: add group summary mode
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: add group summary mode

Add a -g switch to show only a per-group summary.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: reset global gflag to 0 for each call]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: add a man page
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: add a man page

Add a manual page describing xfs_spaceman's behavior.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: minor edits]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: Free space mapping command
Dave Chinner [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: Free space mapping command

Add freespace mapping tool modelled on the xfs_db freesp command.
The advantage of this command over xfs_db is that it can be done
online and is coherent with concurrent modifications to the
filesystem.

This requires the kernel to support the XFS_IOC_GETFSMAP ioctl to map
free space indexes.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[darrick: port from FIEMAPFS to GETFSMAP]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: add new speculative prealloc control
Dave Chinner [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: add new speculative prealloc control

Add an control interface for purging speculative
preallocation via the new ioctls.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[darrick: change xfsctl to ioctl]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: change help to "removes" not "controls"]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: add FITRIM support
Dave Chinner [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: add FITRIM support

Add support for discarding free space extents via the FITRIM
command. Make it easy to discard a single range, an entire AG or all
the freespace in the filesystem.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: minor printf formatting fixup]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_spaceman: space management tool
Dave Chinner [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_spaceman: space management tool

xfs_spaceman is intended as a diagnostic and control tool for space
management operations within XFS. Operations like examining free
space, managing allocation policies, issuing block discards on free
space, etc.

The tool is modelled on the xfs_io interface, allowing both
interactive and command line control of the tool, enabling it to be
used in scripts and automated management tools.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[darrick: change xfsctl to ioctl]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_repair: replace rmap_compare with libxfs version
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_repair: replace rmap_compare with libxfs version

Now that libxfs has a function to compare rmaps, replace xfs_repair's
helper function with that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: support the new getfsmap ioctl
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs_io: support the new getfsmap ioctl

Plumb in all the pieces we need to have xfs_io query the GETFSMAP ioctl
for an arbitrary filesystem.

[sandeen: minor doc fixes]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: introduce the XFS_IOC_GETFSMAP ioctl
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
xfs: introduce the XFS_IOC_GETFSMAP ioctl

Introduce a new ioctl that uses the reverse mapping btree to return
information about the physical layout of the filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[sandeen: rework to have less autoconf magic]
Modified-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agolibxfs: use crc32c slice-by-8 variant by default
Darrick J. Wong [Wed, 21 Jun 2017 22:14:30 +0000 (17:14 -0500)] 
libxfs: use crc32c slice-by-8 variant by default

The crc32c code used in xfsprogs was copied directly from the Linux
kernel.  However, that code selects slice-by-4 by default, which isn't
the fastest -- that's slice-by-8, which trades table size for speed.
Fix some makefile dependency problems and explicitly select the
algorithm we want.  With this patch applied, I see about a 10% drop in
CPU time running xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agolibxcmd: add cvt{int, long} to convert strings to int and long
Darrick J. Wong [Wed, 21 Jun 2017 22:14:29 +0000 (17:14 -0500)] 
libxcmd: add cvt{int, long} to convert strings to int and long

Create some helper functions to convert strings to int or long
in a standard way and work around problems in the C library
atoi/strtol functions.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: refactor numlen into a library function
Darrick J. Wong [Wed, 21 Jun 2017 22:14:29 +0000 (17:14 -0500)] 
xfs_io: refactor numlen into a library function

Refactor the competing numlen implementations into a single library function.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
6 years agometadump: warn about corruption if log is dirty
Jan Tulak [Wed, 21 Jun 2017 22:14:29 +0000 (17:14 -0500)] 
metadump: warn about corruption if log is dirty

Add a warning about possible corruption when exporting a dirty log, as
the log content does not agree with obfuscated metadata.

[sandeen: one more minor wording tweak]

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_metadump: tag metadump image with informational flags
Eric Sandeen [Wed, 21 Jun 2017 22:14:29 +0000 (17:14 -0500)] 
xfs_metadump: tag metadump image with informational flags

After the long discussion about warning the user and/or consumer
of xfs_metadumps about dirty logs, it crossed my mind that we
could use the reserved slot in the metadump header to tag the
file with attributes, so the consumer of the metadump knows how
it was created.

This patch adds 4 flags to describe the metadump: The first simply
indicates the presence of any (or no) informational flags.
The old mb_reserved field has been 0 on disk since inception, so
the presence of XFS_METADUMP_INFO_FLAGS indicates that this metadump
may contain the informational flags:

 - dirty log
 - obfuscated
 - full blocks (unused portions of metadata blocks
                are not zeroed out).

It then adds a new option to xfs_mdrestore, "-i" to show info,
which can be used with or without a target file:

# xfs_mdrestore -i metadumpfile
metadumpfile: not obfuscated, clean log, full metadata blocks

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_repair: handle reading superblock from image on larger sector size filesystem
Zirong Lang [Wed, 21 Jun 2017 19:40:35 +0000 (14:40 -0500)] 
xfs_repair: handle reading superblock from image on larger sector size filesystem

Due to xfs_repair uses direct IO, sometimes it can't read superblock
from an image file has smaller sector size than host filesystem.
Especially that superblock doesn't align with host filesystem's
sector size.

Fortunately, xfsprogs already has code to do isa_file and geometry
check in xfs_repair.c, it turns off O_DIRECT after phase1() if the
sector size is less than the host filesystem's geometry. So move
the isa_file auto detection over up the phase1(), and try to do
once geometry check before phase1() if get_sb() return OK.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: add alignment filter to freesp command
Eric Sandeen [Wed, 21 Jun 2017 19:40:35 +0000 (14:40 -0500)] 
xfs_db: add alignment filter to freesp command

This adds an alignment filter to the xfs_db freesp command, i.e.

xfs_db> freesp -A 4

will show only 4-block aligned free extents.

This can be useful for finding freespace suitable for allocations
with specific alignment requirements, such as inode allocation.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_growfs: ensure target path is an active xfs mountpoint
Bill O'Donnell [Wed, 21 Jun 2017 19:40:35 +0000 (14:40 -0500)] 
xfs_growfs: ensure target path is an active xfs mountpoint

xfs_growfs manpage clearly states that the target path must be
an active xfs mountpoint.

Current behavior allows xfs_growfs to proceed if the target path
resides anywhere on a mounted xfs filesystem. This could lead to
unexpected results. Unless the target path is an active xfs
mountpoint, reject it. Create a new fs table lookup function which
matches only active xfs mount points, not any file residing within
those mountpoints.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agomkfs: remove leftover blkid include
Christoph Hellwig [Thu, 15 Jun 2017 19:16:29 +0000 (14:16 -0500)] 
mkfs: remove leftover blkid include

All topology handling moved to libxcmd a while ago.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agopo/pl.po: update Polish translation for 4.11.0
Jakub Bogusz [Thu, 15 Jun 2017 19:16:28 +0000 (14:16 -0500)] 
po/pl.po: update Polish translation for 4.11.0

Signed-off-by: Jakub Bogusz <qboosh@pld-linux.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agolibxfs: fix xfs_trans_alloc_empty namespace libxfs-4.12-sync
Eric Sandeen [Wed, 14 Jun 2017 21:23:32 +0000 (16:23 -0500)] 
libxfs: fix xfs_trans_alloc_empty namespace

Do all the right libxfs_ magic for this new function.

Reported-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix unaligned access in xfs_btree_visit_blocks
Eric Sandeen [Wed, 14 Jun 2017 20:47:14 +0000 (15:47 -0500)] 
xfs: fix unaligned access in xfs_btree_visit_blocks

Source kernel commit: a4d768e702de224cc85e0c8eac9311763403b368

This structure copy was throwing unaligned access warnings on sparc64:

Kernel unaligned access at TPC[1043c088] xfs_btree_visit_blocks+0x88/0xe0 [xfs]

xfs_btree_copy_ptrs does a memcpy, which avoids it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: avoid mount-time deadlock in CoW extent recovery
Darrick J. Wong [Tue, 13 Jun 2017 19:55:31 +0000 (14:55 -0500)] 
xfs: avoid mount-time deadlock in CoW extent recovery

Source kernel commit: 3ecb3ac7b950ff8f6c6a61e8b7b0d6e3546429a0

If a malicious user corrupts the refcount btree to cause a cycle between
different levels of the tree, the next mount attempt will deadlock in
the CoW recovery routine while grabbing buffer locks.  We can use the
ability to re-grab a buffer that was previous locked to a transaction to
avoid deadlocks, so do that here.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix warnings about unused stack variables
Darrick J. Wong [Tue, 13 Jun 2017 19:47:42 +0000 (14:47 -0500)] 
xfs: fix warnings about unused stack variables

Source kernel commit: 6e747506dde195d3d05fe2bb8ef78aceba28a5e3

Reduce stack usage and get rid of compiler warnings by eliminating
unused variables.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix indlen accounting error on partial delalloc conversion
Brian Foster [Tue, 13 Jun 2017 19:47:33 +0000 (14:47 -0500)] 
xfs: fix indlen accounting error on partial delalloc conversion

Source kernel commit: 0daaecacb83bc6b656a56393ab77a31c28139bc7

The delalloc -> real block conversion path uses an incorrect
calculation in the case where the middle part of a delalloc extent
is being converted. This is documented as a rare situation because
XFS generally attempts to maximize contiguity by converting as much
of a delalloc extent as possible.

If this situation does occur, the indlen reservation for the two new
delalloc extents left behind by the conversion of the middle range
is calculated and compared with the original reservation. If more
blocks are required, the delta is allocated from the global block
pool. This delta value can be characterized as the difference
between the new total requirement (temp + temp2) and the currently
available reservation minus those blocks that have already been
allocated (startblockval(PREV.br_startblock) - allocated).

The problem is that the current code does not account for previously
allocated blocks correctly. It subtracts the current allocation
count from the (new - old) delta rather than the old indlen
reservation. This means that more indlen blocks than have been
allocated end up stashed in the remaining extents and free space
accounting is broken as a result.

Fix up the calculation to subtract the allocated block count from
the original extent indlen and thus correctly allocate the
reservation delta based on the difference between the new total
requirement and the unused blocks from the original reservation.
Also remove a bogus assert that contradicts the fact that the new
indlen reservation can be larger than the original indlen
reservation.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: abstract PF_FSTRANS to PF_MEMALLOC_NOFS
Michal Hocko [Thu, 11 May 2017 19:01:09 +0000 (14:01 -0500)] 
xfs: abstract PF_FSTRANS to PF_MEMALLOC_NOFS

Source kernel commit: 9070733b4efac4bf17f299a81b01c15e206f9ff5

xfs has defined PF_FSTRANS to declare a scope GFP_NOFS semantic quite
some time ago.  We would like to make this concept more generic and use
it for other filesystems as well.  Let's start by giving the flag a more
generic name PF_MEMALLOC_NOFS which is in line with an exiting
PF_MEMALLOC_NOIO already used for the same purpose for GFP_NOIO
contexts.  Replace all PF_FSTRANS usage from the xfs code in the first
step before we introduce a full API for it as xfs uses the flag directly
anyway.

This patch doesn't introduce any functional change.

Link: http://lkml.kernel.org/r/20170306131408.9828-4-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Chris Mason <clm@fb.com>
Cc: David Sterba <dsterba@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Nikolay Borisov <nborisov@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: reserve enough blocks to handle btree splits when remapping
Darrick J. Wong [Thu, 11 May 2017 19:01:09 +0000 (14:01 -0500)] 
xfs: reserve enough blocks to handle btree splits when remapping

Source kernel commit: fe0be23e68200573de027de9b8cc2b27e7fce35e

In xfs_reflink_end_cow, we erroneously reserve only enough blocks to
handle adding 1 extent.  This is problematic if we fragment free space,
have to do CoW, and then have to perform multiple bmap btree expansions.
Furthermore, the BUI recovery routine doesn't reserve /any/ blocks to
handle btree splits, so log recovery fails after our first error causes
the filesystem to go down.

Therefore, refactor the transaction block reservation macros until we
have a macro that works for our deferred (re)mapping activities, and fix
both problems by using that macro.

With 1k blocks we can hit this fairly often in g/187 if the scratch fs
is big enough.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: simplify validation of the unwritten extent bit
Christoph Hellwig [Thu, 11 May 2017 19:01:09 +0000 (14:01 -0500)] 
xfs: simplify validation of the unwritten extent bit

Source kernel commit: 0c1d9e4a61590c2a4d657d1deddd1674f1565097

XFS only supports the unwritten extent bit in the data fork, and only if
the file system has a version 5 superblock or the unwritten extent
feature bit.

We currently have two routines that validate the invariant:
xfs_check_nostate_extents which return -EFSCORRUPTED when it's not met,
and xfs_validate_extent that triggers and assert in debug build.

Both of them iterate over all extents of an inode fork when called,
which isn't very efficient.

This patch instead adds a new helper that verifies the invariant one
extent at a time, and calls it from the places where we iterate over
all extents to converted them from or two the in-memory format.  The
callers then return -EFSCORRUPTED when reading invalid extents from
disk, or trigger an assert when writing them to disk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove unused values from xfs_exntst_t
Christoph Hellwig [Thu, 11 May 2017 19:01:09 +0000 (14:01 -0500)] 
xfs: remove unused values from xfs_exntst_t

Source kernel commit: 37f7f9bbf3b914e94f81426f6f59a3f97f4dc562

We only ever use the normal and unwritten states.  And the actual
ondisk format (this enum isn't despite being in xfs_format.h) only
has space for the unwritten bit anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove the unused XFS_MAXLINK_1 define
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: remove the unused XFS_MAXLINK_1 define

Source kernel commit: 895e9bfc9e36c8e39ea4d2129dc2cbde1aafec99

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: more do_div cleanups
Eric Sandeen [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: more do_div cleanups

Source kernel commit: 4f1adf3373f072246c14119b2aa6dfb4d6510a43

On some architectures do_div does the pointer compare
trick to make sure that we've sent it an unsigned 64-bit
number.  (Why unsigned?  I don't know.)

Fix up the few places that squawk about this; in
xfs_bmap_wants_extents() we just used a bare int64_t so change
that to unsigned.

In xfs_adjust_extent_unmap_boundaries() all we wanted was the
mod, and we have an xfs-specific function to handle that w/o
side effects, which includes proper casting for do_div.

In xfs_daddr_to_ag[b]no, we were using the wrong type anyway;
XFS_BB_TO_FSBT returns a block in the filesystem, so use
xfs_rfsblock_t not xfs_daddr_t, and gain the unsignedness
from that type as a bonus.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove bmap block allocation retries
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: remove bmap block allocation retries

Source kernel commit: 7590632a33ef2d264665576d3d54e50f906fa758

Now that reflink operations don't set the firstblock value we don't
need the workarounds for non-NULL firstblock values without a prior
allocation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove xfs_bmap_remap_alloc
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: remove xfs_bmap_remap_alloc

Source kernel commit: bf8eadbacb24e321c99bbdd901589942712810d1

The main thing that xfs_bmap_remap_alloc does is fixing the AGFL, similar
to what we do in the space allocator.  But the reflink code doesn't touch
the allocation btree unlike the normal space allocator, so we couldn't
care less about the state of the AGFL.

So remove xfs_bmap_remap_alloc and just handle the di_nblocks update in
the caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: introduce xfs_bmapi_remap
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: introduce xfs_bmapi_remap

Source kernel commit: 6ebd5a4413e2afd1b1129135e1cf4a84092550e2

Add a new helper to be used for reflink extent list additions instead of
funneling them through xfs_bmapi_write and overloading the firstblock
member in struct xfs_bmalloca and struct xfs_alloc_args.

With some small changes to xfs_bmap_remap_alloc this also means we do
not need a xfs_bmalloca structure for this case at all.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: pass individual arguments to xfs_bmap_add_extent_hole_real
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: pass individual arguments to xfs_bmap_add_extent_hole_real

Source kernel commit: 6d04558f9fa9d16c4aba7243030f22ef0c1bbf32

For the reflink case we'd much rather pass the required arguments than
faking up a struct xfs_bmalloca.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove attr fork handling in xfs_bmap_finish_one
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: remove attr fork handling in xfs_bmap_finish_one

Source kernel commit: 39e07daa46e34c724ad33f903d166a0a62c20900

We never do COW operations for the attr fork, so don't pretend we handle
them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix integer truncation in xfs_bmap_remap_alloc
Christoph Hellwig [Thu, 11 May 2017 19:01:08 +0000 (14:01 -0500)] 
xfs: fix integer truncation in xfs_bmap_remap_alloc

Source kernel commit: 52813fb13ff90bd9c39a93446cbf1103c290b6e9

bno should be a xfs_fsblock_t, which is 64-bit wides instead of a
xfs_aglock_t, which truncates the value to 32 bits.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: simplify xfs_calc_dquots_per_chunk
Eric Sandeen [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: simplify xfs_calc_dquots_per_chunk

Source kernel commit: d956f813b6e731ef82699a18e468e37d59a1366d

ndquots is a 32-bit value, and we don't care
about the remainder; there is no reason to use do_div
here, it seems to be the result of a decade+ historical
accident.

Worse, the do_div implementation in userspace breaks
when fed a 32-bit dividend, so we commented it out there
in any case.

Change to simple division, and then we can change
userspace to match, and mandate a 64-bit dividend in
the do_div() in userspace as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: implement the GETFSMAP ioctl
Darrick J. Wong [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: implement the GETFSMAP ioctl

Source kernel commit: e89c041338ed6ef2694e6465ca1ba033e0a2978c

Introduce a new ioctl that uses the reverse mapping btree to return
information about the physical layout of the filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: add a couple of queries to iterate free extents in the rtbitmap
Darrick J. Wong [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: add a couple of queries to iterate free extents in the rtbitmap

Source kernel commit: fb3c3de2f65c007f3ee50538ea131f5c4603c7bc

Add _query_range and _query_all functions to the realtime bitmap
allocator.  These two functions are similar in usage to the btree
functions with the same name and will be used for getfsmap and scrub.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: create a function to query all records in a btree
Darrick J. Wong [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: create a function to query all records in a btree

Source kernel commit: e9a2599a249ed7d31771985aea0e761f5680de64

Create a helper function that will query all records in a btree.
This will be used by the online repair functions to examine every
record in a btree to rebuild a second btree.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: provide a query_range function for freespace btrees
Darrick J. Wong [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: provide a query_range function for freespace btrees

Source kernel commit: 2d520bfaa28b60401fbfe581f485a0bb952d881c

Implement a query_range function for the bnobt and cntbt.  This will
be used for getfsmap fallback if there is no rmapbt and by the online
scrub and repair code.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: plumb in needed functions for range querying of the freespace btrees
Darrick J. Wong [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: plumb in needed functions for range querying of the freespace btrees

Source kernel commit: 08438b1e386b7899e8a2ffef59d6ebf29aac530f

Plumb in the pieces (init_high_key, diff_two_keys) necessary to call
query_range on the free space btrees.  Remove the debugging asserts
so that we can make queries starting from block 0.

While we're at it, merge the redundant "if (btnum ==" hunks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: fix up inode validation failure message
Eric Sandeen [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: fix up inode validation failure message

Source kernel commit: bc593eebfd66838a3022ac92782665fbcafc412e

"xfs_iread: validation failed for inode 96 failed"

One "failed" seems like enough.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: remove the ISUNWRITTEN macro
Christoph Hellwig [Thu, 11 May 2017 19:01:07 +0000 (14:01 -0500)] 
xfs: remove the ISUNWRITTEN macro

Source kernel commit: 63fbb4c18d6b04d5f376326395cddf6c2de2c965

Opencoding the trivial checks makes it much easier to read (and grep..).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs: factor out a xfs_bmap_is_real_extent helper
Christoph Hellwig [Thu, 11 May 2017 19:01:03 +0000 (14:01 -0500)] 
xfs: factor out a xfs_bmap_is_real_extent helper

Source kernel commit: 9c4f29d39168bb9363189f0d54ee1202372e7d9b

This checks for all the non-normal extent types, including handling both
encodings of delayed allocations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfsprogs: Release v4.11.0
Eric Sandeen [Fri, 5 May 2017 18:25:49 +0000 (13:25 -0500)] 
xfsprogs: Release v4.11.0

Update all the necessary files for a 4.11.0 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: add missed quotation marks in man page
Zirong Lang [Wed, 3 May 2017 19:54:26 +0000 (14:54 -0500)] 
xfs_io: add missed quotation marks in man page

The description about set_encpolicy command in xfs_io man page missed
some quotation marks. It's a little picky, but it really causes the
quotation marks can't match each other.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: add missed inode command into man page
Zirong Lang [Wed, 3 May 2017 19:54:00 +0000 (14:54 -0500)] 
xfs_io: add missed inode command into man page

There's an "inode" command in xfs_io, it's used to query physical
information about an inode. But there's not any information about
it in xfs_io and other related man pages. So document this command
in the xfs_io man page now.

[sandeen: include some of djwong's edits]

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfsprogs: Release v4.11.0-rc2 v4.11.0-rc2
Eric Sandeen [Tue, 2 May 2017 16:19:48 +0000 (11:19 -0500)] 
xfsprogs: Release v4.11.0-rc2

Update all the necessary files for a 4.11.0-rc2 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: fix statx call for changed UAPI
Eric Sandeen [Tue, 2 May 2017 16:12:58 +0000 (11:12 -0500)] 
xfs_io: fix statx call for changed UAPI

Due to a late-breaking change in the statx UAPI in kernel commit

1e2f82d1 statx: Kill fd-with-NULL-path support in favour of AT_EMPTY_PATH

we'll need to fix the way we call the syscall in xfs_io.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: dump metadata btrees via 'btdump'
Darrick J. Wong [Tue, 2 May 2017 16:12:57 +0000 (11:12 -0500)] 
xfs_db: dump metadata btrees via 'btdump'

Introduce a new 'btdump' command that can print the contents of all
blocks of any metadata subtree in the filesystem.  This enables
developers and forensic analyst to view a metadata structure without
having to navigate the btree manually.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: use iocursor type to guess btree geometry if bad magic
Darrick J. Wong [Tue, 2 May 2017 16:12:55 +0000 (11:12 -0500)] 
xfs_db: use iocursor type to guess btree geometry if bad magic

The function block_to_bt plays an integral role in determining the btree
geometry of a block that we want to manipulate with the debugger.
Normally we use the block magic to find the geometry profile, but if the
magic is bad we'll never find it and return NULL.  The callers of this
function do not check for NULL and crash.

Therefore, if we can't find a geometry profile matching the magic
number, use the iocursor type to guess the profile and scowl about that
to stdout.  This makes it so that even with a corrupt magic we can try
to print the fields instead of crashing the debugger.

[sandeen: comment changes, add magic ASSERT, keep other ASSERTs]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: don't print arrays off the end of a buffer
Darrick J. Wong [Tue, 2 May 2017 16:12:54 +0000 (11:12 -0500)] 
xfs_db: don't print arrays off the end of a buffer

Before printing an array, clamp the array count against the size of the
buffer so that we don't print random heap contents.

[sandeen: re-use fsz variable in call to prfunc]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agomkfs.xfs: Assign proper defaults to rmapbt and reflink flags
Eric Sandeen [Tue, 2 May 2017 16:12:53 +0000 (11:12 -0500)] 
mkfs.xfs: Assign proper defaults to rmapbt and reflink flags

The "defaultval" field in the options structure was a bit confusing,
so when the rmapbt & reflink options got added, the desire was
to keep them off by default, and "defaultval = 0" got set.

However, the purpose of this field is to define the default value
when the flag is specified with no associated value, i.e.

-m rmapbt vs. -m rmapbt=0 or -m rmapbt=1

Today, the resulting behavior is unexpected, and different from any
other mkfs flags; specifying "-m rmapbt,reflink" results in a
filesystem /without/ those features.

Fix these to be consistent with every other boolean flag in the
mkfs options, so that specifying the flag with no value will
enable the feature.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: Add statx support for PowerPC architecture
chandan [Tue, 2 May 2017 16:12:52 +0000 (11:12 -0500)] 
xfs_io: Add statx support for PowerPC architecture

Linux kernel commit f717629c7f834ab2efa05c7dbf0826f1d7c32ade (powerpc:
Wire up statx() syscall) added support for statx syscall for PowerPC
architecture. This commit enables using 'statx' sub-command of xfs_io to
be used on PowerPC.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_io: fix statx definition for non-x86 architecture
Eric Sandeen [Tue, 2 May 2017 16:12:51 +0000 (11:12 -0500)] 
xfs_io: fix statx definition for non-x86 architecture

Apply the same fix to xfs_io as Gwendal did for fstests:

Fix a compilation error for ARM:
__ILP32__ is defined but not __X32_SYSCALL_BIT.

The check should only apply for x86_64 architecture, statx for other
architectures is not implemented yet - see commit 7acc839c9e57
"statx: Add a system call to make enhanced file info available".

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: allow write -d to dqblks
Eric Sandeen [Tue, 2 May 2017 16:12:50 +0000 (11:12 -0500)] 
xfs_db: allow write -d to dqblks

Allow write -d to write bad data and recalculate CRC
for dqblks.

Inspired-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db: allow write -d to inodes
Darrick J. Wong [Tue, 2 May 2017 16:12:31 +0000 (11:12 -0500)] 
xfs_db: allow write -d to inodes

Add a helper function to xfs_db so that we can recalculate the CRC of an
inode whose field we just wrote.  This enables us to write arbitrary
values with a good CRC for the purpose of checking the read verifiers on
a v5 filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
6 years agoxfs_db.8: document write -d option
Darrick J. Wong [Tue, 2 May 2017 16:12:31 +0000 (11:12 -0500)] 
xfs_db.8: document write -d option

The xfs_db write "-d" option allows us to write bad
data with a good CRC, as added in
86769b3 xfs_db: allow recalculating CRCs on invalid metadata
but never documented, so do that now.

[sandeen: split out doc patch]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
7 years agoxfsprogs: Release v4.11.0-rc1 v4.11.0-rc1
Eric Sandeen [Tue, 11 Apr 2017 21:43:46 +0000 (16:43 -0500)] 
xfsprogs: Release v4.11.0-rc1

Update all the necessary files for a 4.11.0-rc1 release.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
7 years agoxfs.5: document barrier deprecation in xfs
Eric Sandeen [Mon, 10 Apr 2017 22:40:58 +0000 (17:40 -0500)] 
xfs.5: document barrier deprecation in xfs

Since kernel v4.10, the barrier mount option is deprecated:

2291dab2 xfs: Always flush caches when integrity is required
4cf4573d xfs: deprecate barrier/nobarrier mount option

Document this fact in the xfs(5) manpage.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>