Re: [PATCH v3 05/23] tty: Remove unnecessary re-test of ldisc ref count

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

 



On 02/07/2013 04:59 PM, Peter Hurley wrote:
> On Thu, 2013-02-07 at 16:16 +0100, Jiri Slaby wrote:
>> On 02/05/2013 09:20 PM, Peter Hurley wrote:
>>> +	char cur_n[TASK_COMM_LEN], tty_n[64];
>>> +	long timeout = 3 * HZ;
>>> +
>>> +	if (tty->ldisc) {	/* Not yet closed */
>>> +		tty_unlock(tty);
>>> +
>>> +		while (tty_ldisc_wait_idle(tty, timeout) == -EBUSY) {
>>> +			timeout = MAX_SCHEDULE_TIMEOUT;
>>> +			printk_ratelimited(KERN_WARNING
>>> +				"%s: waiting (%s) for %s took too long, but we keep waiting...\n",
>>> +				__func__, get_task_comm(cur_n, current),
>>> +				tty_name(tty, tty_n));
>>>  		}
>>> -		break;
>>> +		/* must reacquire both locks and preserve lock order */
>>> +		mutex_unlock(&tty->ldisc_mutex);
>>> +		tty_lock(tty);
>>> +		mutex_lock(&tty->ldisc_mutex);
>>>  	}
>>>  	return !!(tty->ldisc);
>                    ^^^^^^^^^^^^
>                still want me to fix this though?

It's not worth it. It's up to you.

-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux