Re: [RFC] printks in print_inquiry

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

 



On Thu, May 11, 2006 at 09:00:15AM -0600, Matthew Wilcox wrote:
> 
> One of the side-effects of my previous patch to parallelise scsi
> scanning is that it causes print_inquiry to run when there's already a
> lot of other printk traffic.  Due to the way it works, it's very easy
> for print_inquiry to be in the middle of printing something when
> something else chooses to emit a printk.  This could of course happen
> without the async scsi scanning patch, it's just a lot more frequent
> with it.
> 
> This is one way of solving the problem -- accumulate each line into a
> buffer, then display each line in one shot.  However, the comment above

Terser one line output would be nice (even for a few devices), with "scsi"
and bus_id. We don't need "Type", like:

SCSI 2:0:0:0: Vendor: FOO      Model: BAR              Rev: 0.2 ANSI rev: 04

And maybe use printk("%-16s") formatting? But garbage might get printed
for non-ASCII (though the SCSI specs say it is not allowed ...).

> the function says we should be packaging all this up into a hotplug
> event.  Is that still true?  If so, I can do that, and we can forget
> about this patch.

There is already a hotplug event. 

But the timing and output of it won't match well with the other SCSI (sd)
messages, they'll likely be output before hotplug handling for the event.

And then if relying on udev for the output: it replays hotplug events when
it starts up, so (AFAICT) you'd get a flurry of output after all the other
scsi kernel messages for no udev in initrd and for monolithic kernels
(well any time udev is started after scsi discovery).

But try a udev rule like:

ACTION=="add", SUBSYSTEM=="scsi_device" RUN+="/sbin/scsi_notify"

And then /sbin/scsi_notify bash script like:

#! /bin/bash
sys=/sys
sdev=${sys}${PHYSDEVPATH}
bus_id=${sdev##*/}
logger -t scsi "$(printf "%s: Vendor: %-8s Model: %-16s\n" ${bus_id} \
        $(cat ${sdev}/vendor) $(cat ${sdev}/model))"

-- Patrick Mansfield
-
: 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