Re: [PATCH] qla2xxx: Fix schedule_delayed_work() timeout calculations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shivaram,

On Tue, 2013-12-10 at 16:06 +0530, Shivaram Upadhyayula wrote:
> Hi,
> 
> The following patch is a fix for the timeout/delay passed to
> scheduled_delayed_work.
> 

Thanks, patch applied to target-pending/master with a CC' to v3.6.y+
stable code.

Also just for future reference, this patch has extra carriage returns
and did not apply without some light massaging.

Fixed that up for this particular case, but please fix your email client
for future patches.

Thank you,

--nab

> Regards,
> Shivaram U
> 
> commit 1e0ea25bb6c834c1f4b2485f49d36a6c314cb7a4
> Author: Shivaram U <shivaram.u@xxxxxxxxxxxx>
> Date:   Tue Dec 10 15:38:14 2013 +0530
> 
>     Fix schedule_delayed_work() timeout calculations
> 
>     Signed-off-by: Shivaram U <shivaram.u@xxxxxxxxxxxx>
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c
> b/drivers/scsi/qla2xxx/qla_target.c
> index 5964800..3bb0a1d 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -471,7 +471,7 @@ static void qlt_schedule_sess_for_deletion(struct
> qla_tgt_sess *sess,
>  		schedule_delayed_work(&tgt->sess_del_work, 0);
>  	else
>  		schedule_delayed_work(&tgt->sess_del_work,
> -		    jiffies - sess->expires);
> +		    sess->expires - jiffies);
>  }
> 
>  /* ha->hardware_lock supposed to be held on entry */
> @@ -550,13 +550,14 @@ static void qlt_del_sess_work_fn(struct
> delayed_work *work)
>  	struct scsi_qla_host *vha = tgt->vha;
>  	struct qla_hw_data *ha = vha->hw;
>  	struct qla_tgt_sess *sess;
> -	unsigned long flags;
> +	unsigned long flags, elapsed;
> 
>  	spin_lock_irqsave(&ha->hardware_lock, flags);
>  	while (!list_empty(&tgt->del_sess_list)) {
>  		sess = list_entry(tgt->del_sess_list.next, typeof(*sess),
>  		    del_list_entry);
> -		if (time_after_eq(jiffies, sess->expires)) {
> +		elapsed = jiffies;
> +		if (time_after_eq(elapsed, sess->expires)) {
>  			qlt_undelete_sess(sess);
> 
>  			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf004,
> @@ -566,7 +567,7 @@ static void qlt_del_sess_work_fn(struct delayed_work *work)
>  			ha->tgt.tgt_ops->put_sess(sess);
>  		} else {
>  			schedule_delayed_work(&tgt->sess_del_work,
> -			    jiffies - sess->expires);
> +			    sess->expires - elapsed);
>  			break;
>  		}
>  	}
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux