Those two functions are almost identical. The big difference is that we only
move blocks from XR_E_FREE1 to XR_E_FREE state when processing the cnt btree.
Besides that we print bno vs cnt in the messages and obviously validate a
slightly different magic number in the header.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Call the BLKDISCARD ioctl to mark the whole disk as unused before creating
a new filesystem. This will allow SSDs, Arrays with thin provisioning support
and virtual machines to make smarter allocation decisions.
Add a new -K option to prevent mkfs from discarding blocks to aid
trouble-shooting or specialized requirements.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Andi Kleen <andi@firstfloor.org>
Add a new --enable-blkid switch to use libblkid from util-linux to detect
the device geometry and check for existing partitions or filesystem on a
device. Note that this requires the latest blkid from util-linux-ng git
for the topology calls, odler ones won't work. If I had a little more
autoconf fu we might be able to detect a too early one, but right now it
just fails if it's too old and --enable-blkid is specified. We also
stop building libdisk in the blkid case as it's an internal static library
not otherwise used.
For the actual checks I tried to stay as close as possible to the old
code, so we still don't check topology for external log devices. I hope
to add this at a later stage.
As a small addition we also print a warning if trying to create a filesystem
on a partition that is not properly aligned.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Currenly xfsprogs has two different sets of defauls for it's installation
layout. One is in set in the configure.in file and used when running
./configure directly, and the second one is passed by make to ./configure
when configuring through make.
The defaults in the makefile are a lot better, as they install xfsprogs
into the / vs /usr split used by most distributions and enable multi-libs
when detected.
This patch changes the build system to also use the same defaults when
running ./configure. To do this we get rid of some of the hacky
autoconf abuse we had in the past in xfsprogs and just use the normal
default sbindir and libdir variables for /usr/sbin an /usr/lib respecticly
and define new root_sbindir and root_libdir variables for those few
binaries installed into /. The installation to / is disabled if the
user chooses a non-default exec prefix.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
The 3.0.4 release for debian actually had a few more changes than documented.
Add the missing entries so that they appear in the right spot for future
releases.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Eric Sandeen [Tue, 22 Sep 2009 15:22:57 +0000 (10:22 -0500)]
xfs_fsr: fix test for short write
Clang found this one too, as a dead nested assignment.
The point is to see if we write all the bytes; but the initial
assignment is backwards. It's safe in the end, because if they
weren't already equal anyway, we'd have exited prior to this, but
it's worth fixing up for clarity.
Signed-of-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Thu, 17 Sep 2009 19:04:44 +0000 (14:04 -0500)]
libxfs: increase hash chain depth when we run out of slots
A couple people reported xfs_repair hangs after
"Traversing filesystem ..." in xfs_repair. This happens
when all slots in the cache are full and referenced, and the
loop in cache_node_get() which tries to shake unused entries
fails to find any - it just keeps upping the priority and goes
forever.
This can be worked around by restarting xfs_repair with
-P and/or "-o bhash=<largersize>" for older xfs_repair.
I started down the path of increasing the number of hash buckets
on the fly, but Barry suggested simply increasing the max allowed
depth which is much simpler (thanks!)
Resizing the hash lengths does mean that cache_report ends up with
most things in the "greater-than" category:
...
Hash buckets with 23 entries 3 ( 3%)
Hash buckets with 24 entries 3 ( 3%)
Hash buckets with >24 entries 50 ( 85%)
but I think I'll save that fix for another patch unless there's
real concern right now.
I tested this on the metadump image provided by Tomek.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reported-by: Tomek Kruszona <bloodyscarion@gmail.com> Reported-by: Riku Paananen <riku.paananen@helsinki.fi> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Tue, 15 Sep 2009 14:47:24 +0000 (09:47 -0500)]
libdisk: use major/minor when calling dmsetup
In RH bugzilla,
[Bug 471102] Error message seen during mkfs.xfs on multipath device
(unfortunately marked private) reports problems when making xfs
fileystems on multipath devices:
# mkfs -t xfs -f /dev/mpath/oramp4
dm_task_set_name: Device /dev/dm-12 not found
Command failed
dm_task_set_name: Device /dev/dm-12 not found
Command failed
meta-data=/dev/mpath/oramp4 isize=256 agcount=4, agsize=2359680 blks
...
This is because dmsetup takes a "name" which is sometimes, but not
always (I think) the same as the device name.
dmsetup also can take major/minor as arguments, so this may be
simpler at this point.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
xfsprogs: fix the -V option for various shell scripts
For most of the shellscripts wrapping xfs_db or xfs_growfs the -V option
is not implemented correctly. If we just add -V to the options for the
underlying binaries we will never actually call it because the mandatory
device / mount point argument is missing. Instead just call the underlying
command with -V directly and exit early. This is what xfs_bmap.sh,
xfs_mkfile and xfs_metadump.sh are already doing.
Reported-by: Michael Monnerie <michael.monnerie@is.it-management.at> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Alex Elder <aelder@sgi.com>
The usage function in mkfs needs a noreturn annotation too, otherwise
gcc will complain, similarly the do_msg function in repair would need
it if do_abort is set, but because conditional annotations aren't
possible just clean this area up and inline the do_msg function into
it's callers.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Alex Elder <aelder@sgi.com>
xfs_check64.sh and xfs_ncheck64.sh are outdated copies of xfs_check.sh
and xfs_ncheck.sh which call a non-existant xfs_db64 binary. They
are never installed or otherwise used, so remove them. They are
probably a leftover from IRIX
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
xfsprogs: fix the -V option for most shell scripts
For most of the shellscripts wrapping xfs_db or xfs_growfs the -V option
is not implemented correctly. If we just add -V to the options for the
underlying binaries we will never actually call it because the mandatory
device / mount point argument is missing. Instead just call the underlying
command with -V directly and exit early. This is what xfs_bmap.sh,
xfs_mkfile and xfs_metadump.sh are already doing.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Michael Monnerie <michael.monnerie@is.it-management.at> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
The usage function in mkfs needs a noreturn annotation too, otherwise
gcc will complain, similarly the do_msg function in repair would need
it if do_abort is set, but because conditional annotations aren't
possible just clean this area up an inline the do_msg function into
it's callers.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
The get/put unaligned handlers we use to access the extent descriptor
are not good enough for architectures like Sparc that do not tolerate
dereferencing unaligned pointers. Replace the implementation with the
one the kernel uses on these architectures. It might be a tad
slower on architectures like x86, but I don't want to have multiple
implementations around to not let the testing matrix explode.
Also remove the unaligned.h header which includes another implementation
for unaligned access we don't actually use anymore.
Note that the little change to xfs_inode.c needs to go into the kernel
aswell, I will send a patch for that shortly.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Reported-by: Gabriel Vlasiu <gabrielvlasiu@gmail.com> Tested-by: Gabriel Vlasiu <gabrielvlasiu@gmail.com>
Eric Sandeen [Wed, 26 Aug 2009 23:38:59 +0000 (18:38 -0500)]
xfs_io: actually issue 0 size writes
While testing some stuff in generic_write_checks() in the
kernel I realized that you can't actually use xfs_io to send
a 0-byte write in. This is actually a condition worth testing:
If count is zero and fd refers to a regular file,
then write() may return a failure status if one of
the errors below is detected. If no errors are
detected, 0 will be returned without causing any
other effect.
So fix that up.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Eric Sandeen [Fri, 31 Jul 2009 20:49:49 +0000 (15:49 -0500)]
xfs_db: do bounds checking in frag's scanfunc_bmap
This is for http://oss.sgi.com/bugzilla/show_bug.cgi?id=842
Bug 842 - xfs_db crashes on 'frag'
The nrecs in scanfunc_bmap was corrupted & out of bounds, causing
the loop in process_bmbt_reclist to walk well past allocated memory
and eventually segfault.
Add checking to this scanfunc_bmap() similar to that in similar
functions for check, metadump, and repair.
I'm not sure if we can/should print out any more information here...
# db/xfs_db -r -c frag xfs.img
invalid numrecs (46311) in bmapbtd block
actual 38085, ideal 37731, fragmentation factor 0.93%
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Thu, 16 Jul 2009 22:00:29 +0000 (17:00 -0500)]
xfs_repair: clear inodes in incorrect btree format
See also RH bug #510823:
https://bugzilla.redhat.com/show_bug.cgi?id=510823
This check in xfs_iformat_btree() tripped:
/*
* blow out if -- fork has less extents than can fit in
* fork (fork shouldn't be a btree format), root btree
* block has more records than can fit into the fork,
* or the number of extents is greater than the number of
* blocks.
*/
leading to:
Jul 10 23:22:45 hermes kernel: Filesystem "dm-11": corrupt inode 2339503222
(btree). Unmount and run xfs_repair.
Jul 10 23:22:45 hermes kernel: Filesystem "dm-11": XFS internal error
xfs_iformat_btree at line 625 of file fs/xfs/xfs_inode.c.
but repair finds nothing at all. xfs_check, however, does flag the inodes
as problematic:
extent count for ino 2339503222 data fork too low (6) for file format
So I copied the xfs_check test into xfs_repair, and voila, it clears
these inodes.
Ideally repair would move these back into extent format, as long as
they are all valid. But I need to look further at that, and for now
there is no other way out of the situation when the kernel finds
the problematic inode, so I'll commit this as a first step.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Acked-By: Olaf Weber <olaf@sgi.com> Reviewed-by: Christoph Hellwig <hch@infradead.org>
because sb_agcount & sb_agblocks are 32-bit integers; this
may then miss corrupt agbnos for the last ag, which can in
turn lead to out of bounds memory accesses later, for example
when the block nr is used to offset in set_agbno_state():
addr = ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM;
Similar problems in mk_incore_fstree
Reported-by: Jesse Stroik <jstroik@ssec.wisc.edu> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Eric Sandeen [Mon, 8 Jun 2009 21:39:32 +0000 (16:39 -0500)]
xfs_repair: catch bad depth in traverse_int_dir2block
A bad on-disk tree depth in traverse_int_dir2block() can
later cause a segfault when it's used as an array index in
this function; if we get something beyond the max depth,
just error out and the dir will get rebuilt.
Reported-by: Richard Kolkovich <richard@intrameta.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Mon, 18 May 2009 16:06:03 +0000 (11:06 -0500)]
xfsprogs: fix readline/editline for xfs_io and xfs_quota
It looks like libxcmd wasn't ever being built with -DENABLE_READLINE
even when it was asked for by configure --enable-readline=yes
so xfs_io & xfs_quota didn't get the functionality.
This seems to fix it up for me (fixes editline too while we're
at it).
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
David Chinner [Sun, 10 May 2009 19:31:22 +0000 (21:31 +0200)]
mkfs: allow to make larger logs
Increase the maximum log size supported by mkfs.
The log size can be increased easily in mkfs by changing a few
defines and a couple of types to allow the log size to increase to
just under 2GB. Theoretically, the log size can be made much, much
larger than this (up to 2^32 sectors), but going beyond 2^31
*bytes* causes integer overflow issues in the kernel log code.
We use a maximum size of just under 2GB as exactly 2GB will cause
overflow issues on the first transaction reservation.
Maximum log size is now reached at a fs size of ~4TB.
Signed-off-by: Dave Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Currently two xfs_repair processes will happily operate on the same
filesystem device at the same time. It is also possible to mount a
filesystem that is in the process of being repaired.
This patch modifies xfs_repair to open the filesystem devices with
O_EXCL unless it was invoked in "no modify" or "dangerous" mode.
The net effect is that a 2nd xfs_repair will now safely fail with
"xfs_repair: cannot open /dev/foo: Device or resource busy", and a mount
command will fail with (the slightly cryptic) "mount: /dev/foo already
mounted or /mountpoint busy".
Note that this has no effect if the filesystem is stored in a regular
file instead of on a block device.
(Error messages could probably be improved to be more user-friendly in
this new failure case, and it probably wouldn't hurt to add a BLKROGET
ioctl to check for read-only block devices with read-write permissions,
but this does the job for me.)
Signed-off-by: Nathaniel W. Turner <nate@houseofnate.net> Signed-off-by: Christoph Hellwig <hch@lst.de>
We do want to ship the autoconf-generated files over make distclean and
pick them up in Makepkgs so that a user compiling the program doesn't
require autoconf.
For that split up make distclean from make realclean and exclude the
files we want to keep form the former.
To make this easier to maintain adher to stricter rules of use for
CONFIGURE and LDIRT. CONFIGURE now includes all generated files from
autoconf (or for it like our copied install-sh) and gets only removed
on make realclean, but added to LSRCFILES so that Makepkgs can pick it
up. Everything else than needs to be removed on a realclean gets
assigned to LDIRT.
Also split up the configure rule into one to generate the configure
script and one to run it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Frysinger <vapier@gentoo.org>
Remove aclocal.m4 from the repository and generate it when needed.
Move the AC_PROG_LIBTOOL autoconf macro and use libtoolize according to
the libtool info pages.
Make sure that libtoolize adds the auxiliary files (config.guess and config.sub).
Move install-sh into include/ so that libtoolize does not destroy it.
Split up the ``make clean'' and ``make distclean'' targets: the former
removes all files generated during a build. The latter removes all
files generated by libtoolize, autoconf, and configure as well.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
Currently Makepkgs generates the source tarball as xfsprogs-version.src.tar.gz,
which is not what we used for recent releases and not what most other open
source packages do. Change it to xfsprogs-version.tar.gz, and rename the
binary tarball to xfsprogs-version.bin.tar.gz
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Tomasz Majkowski [Fri, 20 Mar 2009 16:01:58 +0000 (17:01 +0100)]
xfs_io: fix extent array reallocation
The XFS_IOC_FSGETXATTRA ioctl only returns the number of allocated
extents, so when we reallocate the extent array in the bmap command
we have to account for the worst case where there is a whole between
each two allocated extents. Also add some slack to that case to
allow for a file growing while we are racing with it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Mike Frysinger [Tue, 24 Feb 2009 18:53:34 +0000 (19:53 +0100)]
fix parallel builds
I noticed that xfsprogs-3.0.0 sometimes fails to build in parallel with an
error about fsr not being able to find libhandle. Looking at the top level
Makefile shows the obvious missing depend (fsr: libhandle). Playing around
a bit found a few more not so obvious missing depends on the include subdir
so I fixed that too.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
The source file lists in the Makefiles were missing a couple of files.
Because those missing files include the new headers that are only
installed on make install-qa that resulting tarball would not even be
buildable.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Felix Blyakher <felixb@sgi.com>
Jan Engelhardt [Sun, 15 Feb 2009 18:11:27 +0000 (19:11 +0100)]
specfile: remove Distribution tag
There exist a number of rpm specfile tags that make it possible to
mislead users of the produced RPM package, because its presence
overrides anything that has been specified in ~/.rpmmacros (or the
configuration files of the build system used). Such is especially
annoying when Packager:/Vendor: is put in specfiles, because it is
then almost impossible to get the name/email of the person who
_really_ did the packaging (assuming s/he set it in their
.rpmmacros).
Such similarly applies to the Distribution: tag, which is why I
suggest its removal and let the build systems provide the proper
string instead.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen [Tue, 10 Feb 2009 20:41:51 +0000 (14:41 -0600)]
allow xfs_freeze to freeze "foreign" filesystems
Now that the freeze ioctl has been elevated to the VFS,
let's let xfs_io and xfs_freeze freeze other filesystems
as well - add the CMD_FOREIGN_OK flag to freeze & thaw.
I think the worst that will happen on older kernels is that
the command will fail with ENOSYS or EINVAL....
Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
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>