smbd/quotas: Remove invalid quota status switch case
authorAnoop C S <anoopcs@redhat.com>
Tue, 20 Oct 2015 05:53:23 +0000 (11:23 +0530)
committerJeremy Allison <jra@samba.org>
Fri, 23 Oct 2015 23:31:21 +0000 (01:31 +0200)
getquota_rslt structure from rquota.h defines the enum
named status whose values start from 1. But in quotas.c
we have an invalid check for status 0. This change is
to remove that particular switch case.

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct 24 01:31:21 CEST 2015 on sn-devel-104

source3/smbd/quotas.c

index c64b63a4a36146b7e7a24205d310f4fbcb2f68ff..3b23e6b2abebd50ba0695cd082b10928324eb74c 100644 (file)
@@ -171,17 +171,12 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t
        }
 
        /*
-        * gqr.status returns 0 if the rpc call fails, 1 if quotas exist, 2 if there is
-        * no quota set, and 3 if no permission to get the quota.  If 0 or 3 return
-        * something sensible.
+        * gqr.status returns 1 if quotas exist, 2 if there is
+        * no quota set, and 3 if no permission to get the quota.
+        * If 3, return something sensible.
         */
 
        switch (gqr.status) {
-       case 0:
-               DEBUG(9,("nfs_quotas: Remote Quotas Failed!  Error \"%i\" \n", gqr.status));
-               ret = False;
-               goto out;
-
        case 1:
                DEBUG(9,("nfs_quotas: Good quota data\n"));
                D.dqb_bsoftlimit = gqr.getquota_rslt_u.gqr_rquota.rq_bsoftlimit;
@@ -197,8 +192,10 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t
                break;
 
        default:
-               DEBUG(9,("nfs_quotas: Remote Quotas Questionable!  Error \"%i\" \n", gqr.status ));
-               break;
+               DEBUG(9, ("nfs_quotas: Unknown Remote Quota Status \"%i\"\n",
+                               gqr.status));
+               ret = false;
+               goto out;
        }
 
        DEBUG(10,("nfs_quotas: Let`s look at D a bit closer... status \"%i\" bsize \"%i\" active? \"%i\" bhard \"%i\" bsoft \"%i\" curb \"%i\" \n",