Skip to contentSkip to conversation

target_alloc is noisy on failure

DISCUSSION Matthew Wilcox 2 participants 2 messages Dec 18, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

I'm looking at moving this code from slave_alloc to target_alloc:

        tp->starget = sdev->sdev_target;
        if (tp->usrflags & SYM_SCAN_BOOT_DISABLED) {
		tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
		starget_printk(KERN_INFO, tp->starget,
				"Scan at boot disabled in NVRAM\n");
		return -ENXIO;
	}

However, returning an error from target_alloc is noisy:

        int error = shost->hostt->target_alloc(starget);

	if(error) {
		dev_printk(KERN_ERR, dev,
			"target allocation failed, error %d\n", error);

so I don't really want to do this. Any thoughts on defining some 'quiet' return values from target_alloc?

#1 lore raw
Quoted 10 lines · Matthew Wilcox

However, returning an error from target_alloc is noisy:

        int error = shost->hostt->target_alloc(starget);

	if(error) {
		dev_printk(KERN_ERR, dev,
			"target allocation failed, error %d\n", error);

so I don't really want to do this. Any thoughts on defining some 'quiet' return values from target_alloc?

Well, obviously, for consistency it should be the same quiet return as for slave_alloc (i.e. -ENXIO).

James