diff options
author | Arkadiusz Miskiewicz <arekm@maven.pl> | 2008-12-30 18:32:01 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2008-12-30 18:32:01 +0100 |
commit | 39d09609abfe3ed20d4a26c61ea7fc151295dd12 (patch) | |
tree | 24ac21fc524be8a0995d1431bde118d89d0d6997 /quota | |
parent | 57cc6e78ab3ed5404c4a108b03d5d051ca5bb316 (diff) | |
download | xfsprogs-dev-39d09609abfe3ed20d4a26c61ea7fc151295dd12.tar.gz |
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>
Diffstat (limited to 'quota')
-rw-r--r-- | quota/edit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/quota/edit.c b/quota/edit.c index 15c72c4e0d..ce7f7e9d43 100644 --- a/quota/edit.c +++ b/quota/edit.c @@ -233,6 +233,8 @@ extractb( s = string + length + 1; v = (__uint64_t)cvtnum(blocksize, sectorsize, s); *value = v >> 9; /* syscalls use basic blocks */ + if (v > 0 && *value == 0) + fprintf(stderr, _("%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"), progname, s); return 1; } return 0; |