Re: iscsi_add_session() warning

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

 



Andrew Morton wrote:
On Tue, 3 Feb 2009 19:12:38 -0500
Kyle McMartin <kyle@xxxxxxxxxxxxx> wrote:

On Tue, Feb 03, 2009 at 04:09:00PM -0800, Andrew Morton wrote:
: 	if (id == ISCSI_MAX_TARGET) {
: 		for (id = 0; id < ISCSI_MAX_TARGET; id++) {
: 			err = device_for_each_child(&shost->shost_gendev, &id,
Possibly GCC just can't figure out that id was reinitialized, so it
thinks that the for loop won't be executed?


Could be.  But that isn't the point...

The point, dear Kyle, is that I misread the code :(

In fact on that codepath the function _will_ return the most recent
return value from device_for_each_child(iscsi_get_next_target_id), and
that value will be non-zero (-EEXIST).  So it looks non-buggy, albeit
rather obscure.

But did we intend to return -EEXIST in the "Too many iscsi targets" case?

I did not. The callers just check for non zero so it will work. It would be best to change it to something meaningful.

When there are no ids for some object left, what is the stadard Exxxx value to return? Would ENOSPC make sense? Here ENOSPC would mean no space in id space left instead of space on a device?
--
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