]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_quota: warn if specified non-zero quota will be round down to zero
authorArkadiusz Miskiewicz <arekm@maven.pl>
Tue, 30 Dec 2008 17:32:01 +0000 (18:32 +0100)
committerChristoph Hellwig <hch@brick.lst.de>
Tue, 30 Dec 2008 17:32:01 +0000 (18:32 +0100)
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>
po/pl.po
quota/edit.c

index b4e1d7654c7c42050c2c495aa29686c6d0cde41d..d13184bcf6db6e89216d929ae78718100e3dd0be 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -3670,6 +3670,11 @@ msgstr "%s: nieprawid
 msgid "%s: invalid project name: %s\n"
 msgstr "%s: nieprawid³owa nazwa projektu: %s\n"
 
+#: ../quota/edit.c:237
+#, c-format
+msgid "%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"
+msgstr "%s: Uwaga: `%s' w blokach quoty oznacza 0 (nieograniczone).\n"
+
 #: ../quota/edit.c:318
 #, c-format
 msgid "%s: unrecognised argument %s\n"
index 15c72c4e0d4ce38fd56214301f5ad1cd0b24e689..ce7f7e9d43ebca9bb54453e40c4bd30aeae288fa 100644 (file)
@@ -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;