Re: [PATCH 1/2] [SCSI] Print only a single message "rejecting I/O to device being removed"

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

 



On Sat, Nov 04 2006, Luben Tuikov wrote:
> --- Jens Axboe <jens.axboe@xxxxxxxxxx> wrote:
> > On Fri, Nov 03 2006, Luben Tuikov wrote:
> > > ... at device removal.
> > > 
> > > Signed-off-by: Luben Tuikov <ltuikov@xxxxxxxxx>
> > > ---
> > >  drivers/scsi/scsi_lib.c    |   10 +++++++---
> > >  drivers/scsi/scsi_scan.c   |    1 +
> > >  include/scsi/scsi_device.h |    3 +++
> > >  3 files changed, 11 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > > index 7b0f9a3..f0de7ca 100644
> > > --- a/drivers/scsi/scsi_lib.c
> > > +++ b/drivers/scsi/scsi_lib.c
> > > @@ -1302,9 +1302,13 @@ static int scsi_prep_fn(struct request_q
> > >  			if(specials_only == SDEV_QUIESCE ||
> > >  					specials_only == SDEV_BLOCK)
> > >  				goto defer;
> > > -			
> > > -			sdev_printk(KERN_ERR, sdev,
> > > -				    "rejecting I/O to device being removed\n");
> > > +
> > > +			if (sdev->num_rej_messages > 0) {
> > > +				sdev->num_rej_messages--;
> > > +				sdev_printk(KERN_ERR, sdev,
> > > +					    "rejecting I/O to device "
> > > +					    "being removed\n");
> > > +			}
> > 
> > How about using some variant of printk_ratelimit() instead?
> 
> Jens, I didn't think to use such a heavy-weight as printk_ratelimit()
> (grabbing irq spinlocks et al), since the device struct would be
> "freed" shortly.  FWIW, one message is more than enough. I'm being
> liberal with 5, but would gladly revert it back to the original
> of one message.

It's a printk, it doesn't matter how heavy weight it is. Just seems
silly to re-invent some sort of printk limiter, when one already exists.

> Feel free to resubmit using printk_ratelimit().

Sorry no plans to do that, I'll let James decide what he wants to take
or not.

-- 
Jens Axboe

-
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