Re: [PATCH] block: don't show io_timeout if driver has no timeout handler

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

 



On Mon, 2019-01-07 at 20:52 +-0800, Weiping Zhang wrote:
+AD4 If the low level driver has no timerout handler, the
                                 +AF4AXgBeAF4AXgBeAF4AXg
                                 timeout?

+AD4 +-static umode+AF8-t queue+AF8-attr+AF8-visible(struct kobject +ACo-kobj, struct attribute +ACo-attr,
+AD4 +-				int n)
+AD4 +-+AHs
+AD4 +-	struct request+AF8-queue +ACo-q +AD0
+AD4 +-		container+AF8-of(kobj, struct request+AF8-queue, kobj)+ADs
+AD4 +-
+AD4 +-	if (attr +AD0APQ +ACY-queue+AF8-io+AF8-timeout+AF8-entry.attr) +AHs
+AD4 +-		if (+ACE-q-+AD4-mq+AF8-ops +AHwAfA +ACE-q-+AD4-mq+AF8-ops-+AD4-timeout)
+AD4 +-			return 0+ADs
+AD4 +-	+AH0

Are there any legacy block drivers left? Do we really need the mq+AF8-ops test?

Additionally, please combine the two nested if-statements into a single
if-statement.

+AD4 +AEAAQA -942,6 +-961,14 +AEAAQA int blk+AF8-register+AF8-queue(struct gendisk +ACo-disk)
+AD4  		goto unlock+ADs
+AD4  	+AH0
+AD4  
+AD4 +-	ret +AD0 sysfs+AF8-create+AF8-group(+ACY-q-+AD4-kobj, +ACY-queue+AF8-attr+AF8-group)+ADs
+AD4 +-	if (ret) +AHs
+AD4 +-		kobject+AF8-del(+ACY-q-+AD4-kobj)+ADs
+AD4 +-		blk+AF8-trace+AF8-remove+AF8-sysfs(dev)+ADs
+AD4 +-		kobject+AF8-put(+ACY-dev-+AD4-kobj)+ADs
+AD4 +-		goto unlock+ADs
+AD4 +-	+AH0

Are you sure the +ACI-goto unlock+ACI is OK here? Shouldn't kobject+AF8-del() be called
to undo the kobject+AF8-add() call if sysfs+AF8-create+AF8-group() fails?

+AD4  	if (queue+AF8-is+AF8-mq(q)) +AHs
+AD4  		+AF8AXw-blk+AF8-mq+AF8-register+AF8-dev(dev, q)+ADs
+AD4  		blk+AF8-mq+AF8-debugfs+AF8-register(q)+ADs
+AD4 +AEAAQA -958,6 +-985,7 +AEAAQA int blk+AF8-register+AF8-queue(struct gendisk +ACo-disk)
+AD4  		if (ret) +AHs
+AD4  			mutex+AF8-unlock(+ACY-q-+AD4-sysfs+AF8-lock)+ADs
+AD4  			kobject+AF8-uevent(+ACY-q-+AD4-kobj, KOBJ+AF8-REMOVE)+ADs
+AD4 +-			sysfs+AF8-remove+AF8-group(+ACY-q-+AD4-kobj, +ACY-queue+AF8-attr+AF8-group)+ADs
+AD4  			kobject+AF8-del(+ACY-q-+AD4-kobj)+ADs
+AD4  			blk+AF8-trace+AF8-remove+AF8-sysfs(dev)+ADs
+AD4  			kobject+AF8-put(+ACY-dev-+AD4-kobj)+ADs
+AD4 +AEAAQA -1006,6 +-1034,7 +AEAAQA void blk+AF8-unregister+AF8-queue(struct gendisk +ACo-disk)
+AD4  		blk+AF8-mq+AF8-unregister+AF8-dev(disk+AF8-to+AF8-dev(disk), q)+ADs
+AD4  	mutex+AF8-unlock(+ACY-q-+AD4-sysfs+AF8-lock)+ADs
+AD4  
+AD4 +-	sysfs+AF8-remove+AF8-group(+ACY-q-+AD4-kobj, +ACY-queue+AF8-attr+AF8-group)+ADs
+AD4  	kobject+AF8-uevent(+ACY-q-+AD4-kobj, KOBJ+AF8-REMOVE)+ADs
+AD4  	kobject+AF8-del(+ACY-q-+AD4-kobj)+ADs
+AD4  	blk+AF8-trace+AF8-remove+AF8-sysfs(disk+AF8-to+AF8-dev(disk))+ADs

Is it necessary to call sysfs+AF8-remove+AF8-group() explicitly? Isn't this something
kobject+AF8-del() does automatically?

Thanks,

Bart.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux