Please don't reply to lustre-devel. Instead, comment in Bugzilla by using the
following link:
https://bugzilla.lustre.org/show_bug.cgi?id=11330
What |Removed |Added
----------------------------------------------------------------------------
Attachment #9198|review?([EMAIL PROTECTED]|review-
Flag|m) |
(From update of attachment 9198)
>@@ -695,8 +698,21 @@ static int ost_brw_read(struct ptlrpc_re
> rc = ost_brw_lock_get(LCK_PR, req->rq_export, ioo, pp_rnb, &lockh);
>+ if (rc != 0) {
> GOTO(out_bulk, rc);
>+ } else {
Since this is an unconditional GOTO() you don't need the "else" and indentation
following it.
>+ /* fix the bug11330 */
Please have a more meaningful comment here, like "/* don't process request if
we were blocked longer than the timeout. b=11330 */".
>+ do_gettimeofday(&present_time);
>+ timediff = cfs_timeval_sub(&present_time,
>&req->rq_arrival_time,NULL);
>+ if (timediff / 1000000 > (long)obd_timeout) {
>+ no_reply = 1;
>+ CERROR("Dropping timed-out opc %d request from %s"
>+ ": %ld seconds old\n", req->rq_reqmsg->opc,
>+ libcfs_id2str(req->rq_peer),
>+ timediff / 1000000);
>+ goto out_lock;
>+ }
[minor] Since this time difference is in the order of many seconds, and
obd_timeout is also seconds, we don't need millisecond accuracy. You can use
cfs_time_current_sec() to just get the seconds here and avoid putting
present_time and timediff on the stack (it is fine to recalculate timediff for
the error message, since this should happen very rarely.
[minor] Also, to make the error message more useful, please put something like
"Dropping timed-out read request", instead of "opc 3 request".
>@@ -922,8 +943,22 @@ static int ost_brw_write(struct ptlrpc_r
> GOTO(out, rc = -ENOMEM);
>
> rc = ost_brw_lock_get(LCK_PW, req->rq_export, ioo, pp_rnb, &lockh);
>- if (rc != 0)
>+ if (rc != 0) {
> GOTO(out_bulk, rc);
>+ } else {
>+ /* fix the bug11330 */
>+ do_gettimeofday(&present_time);
>+ timediff = cfs_timeval_sub(&present_time,
>&req->rq_arrival_time,NULL);
>+ if (timediff / 1000000 > (long)obd_timeout) {
>+ no_reply = 1;
>+ CERROR("Dropping timed-out opc %d request from %s"
>+ ": %ld seconds old\n", req->rq_reqmsg->opc,
>+ libcfs_id2str(req->rq_peer),
>+ timediff / 1000000);
>+ goto out_lock;
>+ }
>+ }
[minor] All of the same changes here also.
_______________________________________________
Lustre-devel mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-devel