linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "wubo (T)" <wubo40@huawei.com>
To: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>,
	open-iscsi <open-iscsi@googlegroups.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	Chris Leech <cleech@redhat.com>, Lee Duncan <lduncan@suse.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "liuzhiqiang (I)" <liuzhiqiang26@huawei.com>,
	Mingfangsen <mingfangsen@huawei.com>
Subject: Antw: [PATCH v2] scsi: avoid potential deadloop in iscsi_if_rx func
Date: Wed, 30 Oct 2019 12:22:37 +0000	[thread overview]
Message-ID: <EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6915DFA4D6@dggeml505-mbs.china.huawei.com> (raw)
In-Reply-To: <5DB946E1020000A100034B9C@gwsmtp.uni-regensburg.de>

> >>> "wubo (T)" <wubo40@huawei.com> schrieb am 30.10.2019 um 08:56 in
> Nachricht
> <EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6915DFA0FE@dggeml505-mbs.china.
> huawei.com>:
> > From: Bo Wu <wubo40@huawei.com>
> 
> ...
> > +			if (--retries < 0) {
> > +				printk(KERN_ERR "Send reply failed too many times. "
> > +				       "Max supported retries %u\n",
> ISCSI_SEND_MAX_ALLOWED);
> 
> Just for "personal taste": Why not simplify the message to:?
> +				printk(KERN_ERR "Send reply failed too many times
> (%u)\n",
>                                ISCSI_SEND_MAX_ALLOWED);
> 
> > +				break;
> > +			}
> > +
> 
> Maybe place the number after "many" as an alternative. I think as the
> message is expected to be rare, a short variant is justified.

Thanks for your suggestion. This problem occured when iscsi_if_send_reply returns -EAGAIN.
Consider possible other anomalies scenes. In order to get diagnostic information, it is better to replace "many" with error code.

Modify as follow:
if (--retries < 0) {
	printk(KERN_WARNING "Send reply failed, error %d\n", err);
	break;
}

> Also one could discuss wether the problem that originates "from external"
> should be KERN_ERR, or maybe just a warning, because the kernel itself can do
> little against that problem, and it's not a "kernel error" after all ;-)

You are right, This problem scene rarely appears .it is friendly to replace the error with warning.

> 
> Regards,
> Ulrich
> 
> 
> 

Thanks,
Bo Wu

      reply	other threads:[~2019-10-30 12:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  7:56 [PATCH v2] scsi: avoid potential deadloop in iscsi_if_rx func wubo (T)
2019-10-30  8:16 ` Antw: " Ulrich Windl
2019-10-30 12:22   ` wubo (T) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6915DFA4D6@dggeml505-mbs.china.huawei.com \
    --to=wubo40@huawei.com \
    --cc=Ulrich.Windl@rz.uni-regensburg.de \
    --cc=cleech@redhat.com \
    --cc=jejb@linux.ibm.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=mingfangsen@huawei.com \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).