Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp16994448ybl; Wed, 1 Jan 2020 19:10:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxZAVQ/oCmqSqdzMzc6SwdFn/ASOZhB1JZbDEy/BPJ353s9HTax3qjddn0exoydxVhVga4Y X-Received: by 2002:a05:6830:15a:: with SMTP id j26mr85730023otp.137.1577934646139; Wed, 01 Jan 2020 19:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577934646; cv=none; d=google.com; s=arc-20160816; b=uKaB9L2rsBNG7E+zRBe6OG5fn54mQbv8zhgxRfLL+o2aYUtxh5ZkB1ukhMM6l7tkaB /dHbN3aPXiZz/0j3Kofeok2P4akvr3jaWCYtrsIL5XBDW3jqaGRRKeTpxI8nGgnuaXTf +ll3eYYdrau0oFLJRwRwq5WsvhwVp4y/oMtrLjFTNkEyu0qDfBppnWVEuQ7gVAwHjBN0 rqaVvW+/6bU39HEfmIrE10w9XuPwHNXExBEeIVUNEeTZbhS10f8szlt10r2lqm2OpqPR F+vHNATwoGGVMlqURxRdOw7iSg0CRLyJCa3y/FnVZCRIJ3Ykv1NbWXBq9beAZOgbkRGd AlFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=/zRNoVfSQWIdIGqBkho+JgQAlRaLk3kS8yRXPy7McZQ=; b=PpZDiX+LZHP3llsxqYsQnJR91hpBPys2+yyPxgq/4vUeCEejBiDXjGk7seRb55G1Wy Ak4c0oIlHaLXRhb4yq81A1awbLlIorHDPeuSK2sc5iXG15kWYmVKN9lmbj+9d2klrzs3 Fd8+mwiTn/w/PqjKIY2LTDwZ6I1OOlRyuaXtyIhpTU0i196W+J1ugwDIfDMWQ4GIkSFm j/K5gWQ5Je7yhKG0N3pgwmatrFR9w2Fa+ZvGO5WxcomuqwXLU4dAu/a2KhYjWAET33Qi I1waysfRC92dvcB7xZYPjLVGMIlhEICUqQn3gvNstKjP3sPj4G8/1tzpBIGZiPVqKUPq N5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DU3WNvMD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si24959458oig.199.2020.01.01.19.10.33; Wed, 01 Jan 2020 19:10:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DU3WNvMD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727553AbgABDJt (ORCPT + 99 others); Wed, 1 Jan 2020 22:09:49 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:47095 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbgABDJt (ORCPT ); Wed, 1 Jan 2020 22:09:49 -0500 Received: by mail-io1-f68.google.com with SMTP id t26so37123219ioi.13 for ; Wed, 01 Jan 2020 19:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/zRNoVfSQWIdIGqBkho+JgQAlRaLk3kS8yRXPy7McZQ=; b=DU3WNvMDy2db71Veo5NgVm3w4ZSMD8E8gUt2aobpSnwYCLbyOHwuMLqHKGQJXdWJMA IieFfcNunORIvOd6IH/0yoGeIQyBYnimTQIpS+EAcQoYkx0Lt582MknRkuASULzfKQaz Gb2LjWAnmNA0KZdvhRvAQaxBrYvNR33G7HSl2SRknrVT6ayz6HAvDoImVuS4CNjpaJPQ es6iN69EpEHKuSskJtwt5iTo9Z7q0kHUC3gKxQo1XJW6DIOzPeORgZavaEjmJrQp78F9 rE83vbA1UVGJywd90dv9RmuGEXTVpZZDbvk7ls6l+SuXUwWP9N/DwycR4CnVPIftyL2Q PbyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/zRNoVfSQWIdIGqBkho+JgQAlRaLk3kS8yRXPy7McZQ=; b=Sl8zslDfqScFogrRiDF4A+1UYsLtvn2YlJq8xkrxIPm/MWeWjendEySRABNiIo5B8+ TNHsp/FZTuOl8rwaSl6x9eRuc2ex9uioG9ms9CmRLW3KvTl5o1Pl0NQN/41YJNPCBtJJ GJ9KU0x/e7lSCLVQrnA20qRnkzWzohcnCwHr2Ot+ClNeUrLDbxHT8iIVej4LbQkbNW8r kLoazlsLc7WcA/sMahHo/W4Mxa+bxI6jY6ygTeahL8R5d/2Ih3YURTDcqGek/TzT6U7N fh0nSd6D8qSfhEihq1MHEX0H1eLoMB6Hr06kjYV7NLQMWQXyfFxgeOHQOYTD1xb1f0s5 1oQw== X-Gm-Message-State: APjAAAU7cGARdByJinMOWj3vmQ7jz3rLGp0rbCyOY++ZAsOAKRzGehY8 7CQAcm+Am99NuJL0CqlySC5s+RzJ9/JIROdHp64= X-Received: by 2002:a02:780f:: with SMTP id p15mr62360863jac.91.1577934588859; Wed, 01 Jan 2020 19:09:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac0:9191:0:0:0:0:0 with HTTP; Wed, 1 Jan 2020 19:09:48 -0800 (PST) In-Reply-To: References: <20191231150226.GA523748@light.dominikbrodowski.net> <20200101003017.GA116793@rani.riverdale.lan> <20200101183243.GB183871@rani.riverdale.lan> From: youling 257 Date: Thu, 2 Jan 2020 11:09:48 +0800 Message-ID: Subject: Re: [PATCH] early init: open /dev/console with O_LARGEFILE To: Linus Torvalds Cc: Arvind Sankar , Dominik Brodowski , Linux Kernel Mailing List , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020-01-02 5:39 GMT+08:00, Linus Torvalds : > On Wed, Jan 1, 2020 at 10:32 AM Arvind Sankar > wrote: >> >> Also, this shouldn't impact the current issue I think, but won't doing >> filp_open followed by 3 f_dupfd's cause the file->f_count to become 4 >> but with only 3 open fd's? Don't we have to do an fd_install for the >> first one and only 2 f_dupfd's? > > I think *this* is the real reason for the odd regression. > > Because we're leaking a file count, the original /dev/console stays > open, and we end up never calling file->f_op->release(). > > So we don't call tty_release() on that original /dev/console open, and > one effect of that is that we never then call session_clear_tty(), > which should make sure that all the processes in that session ID have > their controlling tty (signal->tty pointer) cleared. > > And if that original controlling tty wasn't cleared, then subsequent > calls to set the controlling tty won't do anything, and who knows what > odd session leader confusion we might have. > > youling, can you check if - instead of the revert - this simple 'add > an fput' fixes your warning. > > I'm not saying that the revert is wrong at this point, but honestly, > I'd like to avoid the "we revert because we didn't understand what > went wrong". It would be good to go "Aaaahhhh, _that_ was the > problem". > > Linus > test this patch.diff, no the system/bin/sh warning, fixed.