Fail gracefully and with a useful error message when we detect an
invalid superblock magic in xfs_db. Add a new -F flag to continue
when seeing the invalid magic number - that way xfs_check and
xfs_metadump can be used on a filesystem that has a corrupted primary
superblock.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Felix Blyakher <felixb@sgi.com>
gettext: make build system look more like automake gettext
configure.in: Find all *.c files using find so no need to update
po/Makefile manually (previous method leads to problems like when
someone adds new .c file and forgets to update Makefile - then
translations are removed after update).
po/Makefile: Use automaticly found .c files. Add update-po target.
Show translation statistics when processing po files. Turn on msgfmt
validation (-c).
How to update translations now?
$ ./configure
$ cd po; make update-po
$ vim your.po
$ make
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Reviewed-by: Christoph Hellwig <hch@lst.de>
xfs_quota: add support for passing project paths on cmdline
/etc/project is currently required for using project quota. This
patch adds ability to specify paths at command line.
fs_table_insert_project_path() introduced in libxcmd. Allows to insert
arbitrary path to fs_* iterating engine. We insert our paths with
-1 as project id (because we know no "original" id for this path
and generally this knowledge is not needed).
New option introduced for paths passing - project -p <path>.
Example:
$ sudo rm -f /etc/projects /etc/projid
$ sudo ./xfs_quota -x -c "project -p /tmp/xx -s 60"
Setting up project 60 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 60 with
recursion depth infinite (-1).
$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 60"
Checking project 60 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 60 with
recursion depth infinite (-1).
$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 70"
Checking project 70 (path /tmp/xx)...
/tmp/xx - project identifier is not set (inode=60, tree=70)
/tmp/xx/file1 - project identifier is not set (inode=60, tree=70)
/tmp/xx/file2 - project identifier is not set (inode=60, tree=70)
/tmp/xx/file3 - project identifier is not set (inode=60, tree=70)
/tmp/xx/dir1 - project identifier is not set (inode=60, tree=70)
/tmp/xx/dir2 - project identifier is not set (inode=60, tree=70)
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).
$ sudo ./xfs_quota -x -c "project -p /tmp/xx -s 70"
Setting up project 70 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).
$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 70"
Checking project 70 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Reviewed-by: Donald Douwsma <ddouwsma@bigpond.net.au> Reviewed-by: Christoph Hellwig <hch@lst.de>
xfs_quota project directory depth processing can now be limited
to certain depth. For example: xfs_quota -x -c "project -d 2 -s 10"
limits recursion to level 2.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Reviewed-by: Donald Douwsma <ddouwsma@bigpond.net.au> Reviewed-by: Christoph Hellwig <hch@lst.de>
Nathan Scott [Wed, 28 Jan 2009 08:47:03 +0000 (09:47 +0100)]
rpm spec file update
Since binaries have moved between xfsprogs and xfsdump packages
in version 3.0.0, we need to fix the dependencies in the rpm
specfiles, else rpm will complain.
While in there, remove xfs-cmds Provides/Obsoletes lines, there
is no way anyone is ever going to be requiring those anymore (no
real-world upgrade path having such old skool SGI-released rpms).
Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Nathan Scott [Wed, 28 Jan 2009 08:47:03 +0000 (09:47 +0100)]
rpm spec file update
Since binaries have moved between xfsprogs and xfsdump packages
in version 3.0.0, we need to fix the dependencies in the rpm
specfiles, else rpm will complain.
While in there, remove xfs-cmds Provides/Obsoletes lines, there
is no way anyone is ever going to be requiring those anymore (no
real-world upgrade path having such old skool SGI-released rpms).
Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
There's really no reason to hide fsr in xfsdump, so move it over
to xfsprogs now that we have a 3.0 release with some major shaking
pending. The only code change is to replace the single attr_setf call
with a fsetxattr to avoid a dependency on libattr.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nathan Scott <nscott@aconex.com>
Michael Sinz [Tue, 30 Dec 2008 17:32:51 +0000 (18:32 +0100)]
xfs_check: fix exit codes
xfs_check returns success when the superblock magic is invalid - this makes it
return the serious error exit code (3) for this case, and the invalid arguments
exit code (1) if the arguments to xfs_check were wrong.
A glance at the code suggests that other xfs_check failures appear to return
the correct error codes.
Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Michael Sinz <michael.sinz@sinz.org>
xfs_quota: warn if specified non-zero quota will be round down to zero
User specified quota limit is internally converted to "basic blocks"
unit (512 bytes in size). Quota value will be silently converted
to zero when user enters any value lower than 512 bytes.
Warn in such case:
: # ./xfs_quota -x -c "limit -u bsoft=431 12000" /home
: xfs_quota: Warning: `431' in quota blocks is 0 (unlimited).
Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Jakub Bogusz [Tue, 30 Dec 2008 17:22:46 +0000 (18:22 +0100)]
Fix build when gettext is enabled
Build fails when gettext is enabled:
progress.c:16: error: initializer element is not constant
progress.c:16: error: (near initialization for ‘rpt_types[0]’)
progress.c:18: error: initializer element is not constant
progress.c:18: error: (near initialization for ‘rpt_types[1]’)
[...]
Fix that using commonly standard N_() macro.
Improvements by Arkadiusz Miśkiewicz <arekm@maven.pl> Reviewed-by: Christoph Hellwig <hch@lst.de>
Barry Naujok [Tue, 2 Dec 2008 03:03:12 +0000 (03:03 +0000)]
Linux kernels (at least up until 2.6.27) are lacking compat sys_ustat
handlers on some platforms (notably PPC) so that if called from 32 bits
on a 64-bit kernel, the kernel will copy out too much (32 bytes onto a
20-byte structure):
This will be fixed upstream, but for the benefit of older kernels we
may want to guard against this by padding the structure we pass into
the syscall. We don't care about the values anyway, just the return
value.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Merge of master-melb:xfs-cmds:32618a by kenmcd.
Barry Naujok [Fri, 3 Oct 2008 04:35:04 +0000 (04:35 +0000)]
Consolidate btree block handling for xfs_db
Currently xfs_db has five different implementations for poking at btree
blocks, even duplicating code for btree blocks with entirely identical
layout (bmapbta vs bmapbtd and bno vs cnt). Merge all these into
a single implementation that uses a table of btree characteristics keyed
of their magic number.
There's probably a way to further consolidate the magic arrays for the
different types, but I don't quite understand xfs_db's table driven
command parser for that.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge of master-melb:xfs-cmds:32248a by kenmcd.
Barry Naujok [Mon, 29 Sep 2008 15:55:04 +0000 (15:55 +0000)]
Update the shared kernel and userspace code to the latest version with
the generic btree implementation. Contains one additional patch to move
the __KERNEL__ ifdefs around in xfs_btree.h over the current kernel
version, which is posted and waiting to be commited for the kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge of master-melb:xfs-cmds:32222a by kenmcd.
Barry Naujok [Fri, 5 Sep 2008 04:10:01 +0000 (04:10 +0000)]
Change the libxfs cache MRU to only store unreferenced blocks
so the searching doesn't scan through referenced blocks.
Merge of master-melb:xfs-cmds:32049a by kenmcd.
Barry Naujok [Mon, 1 Sep 2008 03:59:15 +0000 (03:59 +0000)]
Point out the actual source file missing when generateing pkg.pot file
rather than obscure error message
Merge of master-melb:xfs-cmds:32010a by kenmcd.
Point out the actual source file missage when generating pkg.pot file
rather than obscure error message
Barry Naujok [Wed, 27 Aug 2008 04:12:12 +0000 (04:12 +0000)]
Increase default maximum extent size for xfs_metadump when copying
directory contents to 1000 blocks per extent.
Merge of master-melb:xfs-cmds:31977a by kenmcd.
Niv Sardi [Thu, 13 Mar 2008 05:16:46 +0000 (05:16 +0000)]
Update mkfs manpage for new defaults:
log, attr and inodes v2,
Drop the ability to turn unwritten extents off completly,
reduce imaxpct for big filesystems, less AGs for single disks configs.
Merge of master-melb:xfs-cmds:30662a by kenmcd.
Niv Sardi [Fri, 16 Nov 2007 05:16:34 +0000 (05:16 +0000)]
Default to log, attr, inodes v2, Drop the ability to turn unwritten extents off completly, reduce imaxpct for big filesystems, less AGs for single disks configs.
-
Default to log version 2
Change logversion to 2 in xfs_mkfs.c
-
Default to version 2 attributes.
Change attrversion from 0 to 2 in xfs_mkfs.c
-
Drop the ability to turn unwritten extents off completly
unwritten extents on linux are generally a bad idea, this option
should not be used.
Remove the mount option from xfs_mkfs.c:
remove it from option list,
remove it from mkfs output.
Update xfs.mkfs manpage.
-
V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS,
Activate XFS_SB_VERSION_NLINKBIT per default, which will enable V2 INODES.
refactor bits that we want everytime in XFS_DFL_SB_VERSION_BITS.
-
reduce imaxpct for big filesystems,
imaxpct is set to 25% (XFS_DFL_IMAXIMUM_PCT) for FS < 1 TB,
then 5% for FS < 50 TB,
and then (over 50 TB) 1%.
It is implemented as a simple step function in calc_default_imaxpct()
-
less AGs for single disks configs.
get the underlying structure with get_subvol_stripe_wrapper(),
and pass sunit | swidth as an argument to calc_default_ag_geometry().
if it is set, we are in single disk, get XFS_AG_MAX_BLOCKS for FS >= 4TB,
and calculate ag numbers regarding to that.
get 4 AGs for FS < 4TB.
we calculate according to blocks or count if we have them, add an assert to
ensure we have one of the 2.
Merge of master-melb:xfs-cmds:30077a by kenmcd.