Whamcloud - gitweb
b=21919 Do not resend quota_ctl requests
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Thu, 4 Mar 2010 01:02:11 +0000 (17:02 -0800)
committerRobert Read <rread@sun.com>
Thu, 4 Mar 2010 01:02:11 +0000 (17:02 -0800)
Do not resend quota_ctl requests infinitely.

i=Johann Lombardi
i=ZhiYong Tian

lustre/include/lprocfs_status.h
lustre/include/obd.h
lustre/ldlm/ldlm_lib.c
lustre/mdc/lproc_mdc.c
lustre/obdclass/lprocfs_status.c
lustre/osc/lproc_osc.c
lustre/quota/quota_ctl.c
lustre/quota/quota_internal.h
lustre/tests/sanity-quota.sh

index ad308df..c525517 100644 (file)
@@ -522,11 +522,6 @@ extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
                            unsigned long count, void *data);
 
 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
                            unsigned long count, void *data);
 
-extern int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off,
-                                         int count, int *eof, void *data);
-extern int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer,
-                                         unsigned long count, void *data);
-
 /* Statfs helpers */
 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
                               int count, int *eof, void *data);
 /* Statfs helpers */
 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
                               int count, int *eof, void *data);
index bedb530..36fa749 100644 (file)
@@ -286,8 +286,6 @@ struct filter_obd {
         cfs_semaphore_t      fo_init_lock;      /* group initialization lock */
         int                  fo_committed_group;
 
         cfs_semaphore_t      fo_init_lock;      /* group initialization lock */
         int                  fo_committed_group;
 
-#define CLIENT_QUOTA_DEFAULT_RESENDS 10
-
         cfs_spinlock_t       fo_objidlock;      /* protect fo_lastobjid */
 
         unsigned long        fo_destroys_in_progress;
         cfs_spinlock_t       fo_objidlock;      /* protect fo_lastobjid */
 
         unsigned long        fo_destroys_in_progress;
@@ -483,7 +481,6 @@ struct client_obd {
         struct lu_client_seq    *cl_seq;
 
         cfs_atomic_t             cl_resends; /* resend count */
         struct lu_client_seq    *cl_seq;
 
         cfs_atomic_t             cl_resends; /* resend count */
-        cfs_atomic_t             cl_quota_resends; /* quota related resend count */
 };
 #define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
 
 };
 #define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
 
index b0ac944..4eb627a 100644 (file)
@@ -305,7 +305,6 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         cli->cl_cksum_type = cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
 #endif
         cfs_atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS);
         cli->cl_cksum_type = cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
 #endif
         cfs_atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS);
-        cfs_atomic_set(&cli->cl_quota_resends, CLIENT_QUOTA_DEFAULT_RESENDS);
 
         /* This value may be changed at connect time in
            ptlrpc_connect_interpret. */
 
         /* This value may be changed at connect time in
            ptlrpc_connect_interpret. */
index bc91243..e78332d 100644 (file)
@@ -263,8 +263,6 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
         { "mds_conn_uuid",   lprocfs_rd_conn_uuid,   0, 0 },
         { "max_rpcs_in_flight", mdc_rd_max_rpcs_in_flight,
                                 mdc_wr_max_rpcs_in_flight, 0 },
         { "mds_conn_uuid",   lprocfs_rd_conn_uuid,   0, 0 },
         { "max_rpcs_in_flight", mdc_rd_max_rpcs_in_flight,
                                 mdc_wr_max_rpcs_in_flight, 0 },
-        { "quota_resend_count",  lprocfs_rd_quota_resend_count,
-                                 lprocfs_wr_quota_resend_count, 0},
         { "timeouts",        lprocfs_rd_timeouts,    0, 0 },
         { "import",          lprocfs_rd_import,      0, 0 },
         { "state",           lprocfs_rd_state,       0, 0 },
         { "timeouts",        lprocfs_rd_timeouts,    0, 0 },
         { "import",          lprocfs_rd_import,      0, 0 },
         { "state",           lprocfs_rd_state,       0, 0 },
index 9510296..9978fe8 100644 (file)
@@ -940,30 +940,6 @@ int lprocfs_at_hist_helper(char *page, int count, int rc,
         return rc;
 }
 
         return rc;
 }
 
-int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off,
-                                  int count, int *eof, void *data)
-{
-        struct obd_device *obd = data;
-
-        return snprintf(page, count, "%d\n",
-                        cfs_atomic_read(&obd->u.cli.cl_quota_resends));
-}
-
-int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer,
-                                  unsigned long count, void *data)
-{
-        struct obd_device *obd = data;
-        int val, rc;
-
-        rc = lprocfs_write_helper(buffer, count, &val);
-        if (rc)
-                return rc;
-
-        cfs_atomic_set(&obd->u.cli.cl_quota_resends, val);
-
-        return count;
-}
-
 /* See also ptlrpc_lprocfs_rd_timeouts */
 int lprocfs_rd_timeouts(char *page, char **start, off_t off, int count,
                         int *eof, void *data)
 /* See also ptlrpc_lprocfs_rd_timeouts */
 int lprocfs_rd_timeouts(char *page, char **start, off_t off, int count,
                         int *eof, void *data)
@@ -2328,8 +2304,6 @@ EXPORT_SYMBOL(lprocfs_rd_kbytesfree);
 EXPORT_SYMBOL(lprocfs_rd_kbytesavail);
 EXPORT_SYMBOL(lprocfs_rd_filestotal);
 EXPORT_SYMBOL(lprocfs_rd_filesfree);
 EXPORT_SYMBOL(lprocfs_rd_kbytesavail);
 EXPORT_SYMBOL(lprocfs_rd_filestotal);
 EXPORT_SYMBOL(lprocfs_rd_filesfree);
-EXPORT_SYMBOL(lprocfs_rd_quota_resend_count);
-EXPORT_SYMBOL(lprocfs_wr_quota_resend_count);
 
 EXPORT_SYMBOL(lprocfs_write_helper);
 EXPORT_SYMBOL(lprocfs_write_frac_helper);
 
 EXPORT_SYMBOL(lprocfs_write_helper);
 EXPORT_SYMBOL(lprocfs_write_frac_helper);
index 9140a58..3815169 100644 (file)
@@ -624,8 +624,6 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
         { "checksums",       osc_rd_checksum, osc_wr_checksum, 0 },
         { "checksum_type",   osc_rd_checksum_type, osc_wd_checksum_type, 0 },
         { "resend_count",    osc_rd_resend_count, osc_wr_resend_count, 0},
         { "checksums",       osc_rd_checksum, osc_wr_checksum, 0 },
         { "checksum_type",   osc_rd_checksum_type, osc_wd_checksum_type, 0 },
         { "resend_count",    osc_rd_resend_count, osc_wr_resend_count, 0},
-        { "quota_resend_count",  lprocfs_rd_quota_resend_count,
-                                 lprocfs_wr_quota_resend_count, 0},
         { "timeouts",        lprocfs_rd_timeouts,      0, 0 },
         { "contention_seconds", osc_rd_contention_seconds,
                                 osc_wr_contention_seconds, 0 },
         { "timeouts",        lprocfs_rd_timeouts,      0, 0 },
         { "contention_seconds", osc_rd_contention_seconds,
                                 osc_wr_contention_seconds, 0 },
index 91fee1d..7c9a66a 100644 (file)
@@ -294,7 +294,7 @@ int client_quota_ctl(struct obd_device *unused, struct obd_export *exp,
         struct ptlrpc_request   *req;
         struct obd_quotactl     *oqc;
         const struct req_format *rf;
         struct ptlrpc_request   *req;
         struct obd_quotactl     *oqc;
         const struct req_format *rf;
-        int                      ver, opc, rc, resends = 0;
+        int                      ver, opc, rc;
         ENTRY;
 
         if (!strcmp(exp->exp_obd->obd_type->typ_name, LUSTRE_MDC_NAME)) {
         ENTRY;
 
         if (!strcmp(exp->exp_obd->obd_type->typ_name, LUSTRE_MDC_NAME)) {
@@ -309,8 +309,6 @@ int client_quota_ctl(struct obd_device *unused, struct obd_export *exp,
                 RETURN(-EINVAL);
         }
 
                 RETURN(-EINVAL);
         }
 
-restart_request:
-
         req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), rf, ver, opc);
         if (req == NULL)
                 RETURN(-ENOMEM);
         req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), rf, ver, opc);
         if (req == NULL)
                 RETURN(-ENOMEM);
@@ -342,16 +340,6 @@ restart_request:
 out:
         ptlrpc_req_finished(req);
 
 out:
         ptlrpc_req_finished(req);
 
-        if (client_quota_recoverable_error(rc)) {
-                resends++;
-                if (!client_quota_should_resend(resends, &exp->exp_obd->u.cli)) {
-                        CERROR("too many resend retries, returning error\n");
-                        RETURN(-EIO);
-                }
-
-                goto restart_request;
-        }
-
         return rc;
 }
 
         return rc;
 }
 
index babb923..a96390d 100644 (file)
@@ -213,15 +213,4 @@ int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
                     struct obd_quotactl *oqctl);
 int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
 
                     struct obd_quotactl *oqctl);
 int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
 
-static inline int client_quota_recoverable_error(int rc)
-{
-        return (rc == -ETIMEDOUT || rc == -EAGAIN);
-}
-
-static inline int client_quota_should_resend(int resend, struct client_obd *cli)
-{
-        return (cfs_atomic_read(&cli->cl_quota_resends) >= 0) ?
-                cfs_atomic_read(&cli->cl_quota_resends) > resend : 1;
-}
-
 #endif
 #endif
index 589bc6a..7d362c3 100644 (file)
@@ -2061,7 +2061,6 @@ test_29()
         local BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
         local timeout
         local pid
         local BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
         local timeout
         local pid
-        local origin_resends
 
         if at_is_enabled; then
                 timeout=$(at_max_get client)
 
         if at_is_enabled; then
                 timeout=$(at_max_get client)
@@ -2071,9 +2070,6 @@ test_29()
                 lctl set_param timeout=10
         fi
 
                 lctl set_param timeout=10
         fi
 
-        origin_resends=$(lctl get_param -n mdc.${FSNAME}-*.quota_resend_count | head -1)
-        lctl set_param -n mdc.${FSNAME}-*.quota_resend_count 0
-
         #define OBD_FAIL_MDS_QUOTACTL_NET 0x12e
         lustre_fail mds 0x12e
 
         #define OBD_FAIL_MDS_QUOTACTL_NET 0x12e
         lustre_fail mds 0x12e
 
@@ -2092,7 +2088,6 @@ test_29()
                 lctl set_param timeout=$timeout
         fi
 
                 lctl set_param timeout=$timeout
         fi
 
-        lctl set_param -n mdc.${FSNAME}-*.quota_resend_count $origin_resends
         resetquota -u $TSTUSR
 }
 run_test_with_stat 29 "unhandled quotactls must not hang lustre client (19778) ========"
         resetquota -u $TSTUSR
 }
 run_test_with_stat 29 "unhandled quotactls must not hang lustre client (19778) ========"