Re: [PATCH 03/19] sg: sg_log and is_enabled

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

 



On 5/24/19 11:47 AM, Douglas Gilbert wrote:
> Replace SCSI_LOG_TIMEOUT macros with SG_LOG macros across the driver.
> The definition of SG_LOG calls SCSI_LOG_TIMEOUT if scsi_device
> pointer is non-zero, calls pr_info otherwise. Prints the thread id
> if current is non-zero, -1 otherwise.

What makes you think that logging the thread ID is useful?

What is sg-specific about the SG_LOG() macro? Why to restrict the
introduction of this macro to the sg code?

Do we really need the SG_LOG() macro?

> +#if IS_ENABLED(CONFIG_SCSI_LOGGING)
> +#define SG_LOG(depth, sdp, fmt, a...)					\
> +	do {								\
> +		char _b[160];						\

No new hardcoded buffer size limits please. Such size limits are
typically either too small or too big.

> +		int _tid = (current ? current->pid : -1);		\

Is current ever NULL?

Is this macro ever invoked from interrupt context? I'm asking because I
think in interrupt context 'current' refers to the context that has been
interrupted instead of the interrupt context.

Thanks,

Bart.



[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