s3:vfs_gpfs: Check softquota before gracetime
authorChristof Schmitt <christof.schmitt@us.ibm.com>
Mon, 18 Jun 2012 23:13:06 +0000 (16:13 -0700)
committerChristian Ambach <ambi@samba.org>
Wed, 11 Jul 2012 17:38:47 +0000 (19:38 +0200)
gpfs_quotactl can return a non-zero softquota gracetime even when no
softquota has been set. This could lead to "disk full" being reported to
a client. The easiest fix is to check for a valid softquota before
checking the softquota gracetime.

source3/modules/vfs_gpfs.c

index a165cfadd84207245303d27fc73d096cd5c87fcc..ddd048acc0668722ad91fa1fb0899cce8b2417e3 100644 (file)
@@ -1562,7 +1562,8 @@ static void vfs_gpfs_disk_free_quota(struct gpfs_quotaInfo qi, time_t cur_time,
         * When the grace time for the exceeded soft block quota has been
         * exceeded, the soft block quota becomes an additional hard limit.
         */
-       if (qi.blockGraceTime && cur_time > qi.blockGraceTime) {
+       if (qi.blockSoftLimit &&
+           qi.blockGraceTime && cur_time > qi.blockGraceTime) {
                /* report disk as full */
                *dfree = 0;
                *dsize = MIN(*dsize, usage);