From patchwork Wed Sep 14 14:48:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9331813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ADC746077A for ; Wed, 14 Sep 2016 14:49:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9992A0EA for ; Wed, 14 Sep 2016 14:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 947F42A0F0; Wed, 14 Sep 2016 14:49:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A00C2A0EF for ; Wed, 14 Sep 2016 14:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764295AbcINOto (ORCPT ); Wed, 14 Sep 2016 10:49:44 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35118 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762428AbcINOsi (ORCPT ); Wed, 14 Sep 2016 10:48:38 -0400 Received: by mail-pf0-f194.google.com with SMTP id z84so891672pfi.2; Wed, 14 Sep 2016 07:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qPUfksRBI4bpaSl8CIWqqP0JwAWCRcpqKaLJFlIt0O4=; b=HwM5h5KPV+NoAV9XBYDzgQIA+rOdoUfa0Xivl5sk49ivsIbYqbOQnnBw9vj4i/dfjO VHA5RWML9SgBSP6LYmcOe7TbAP7U2U9Vj4gd9w4Re7GYceTc9rzWF5qsAL6ePLE+MvQr 8kCnW/KktI9K1atzTp2z5FpfkJTidPQEBcLd10ntVqGd2X2KxBKfXx5W0yJ3mgCJa3EO ovByRmb9w0XFPTLbj3UJB1XXIcP/cG5p4wgm32B1spXds6XSDZdgqsX/fdtT9UhIFsff YL5Zd4MYKDrNgOYBSoDKZENBI65TRY/OvAcuLFKK3/fITe/IH2IebYBnCEPXGfyjPISj /B7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qPUfksRBI4bpaSl8CIWqqP0JwAWCRcpqKaLJFlIt0O4=; b=Az96L4FZb3MNHp4t2R4LeASs3tHwyP+xSzeSPTKE96r5LQDepNKS1YK1w8N+Oa5ft9 2ldjvoumLhNVsxDfKmGl9nG1cFOXSYLijzz/wmRGMuNevsiLx/MvhXMwulI0s86i5EfJ BW2Wwk5cT0leybTQdLuWckguzgey2vMlHQeYBITjYYKplKRiWZEgEfy5KLZ1j6wWP9B7 FN3hDh4BwN5djJPPFUxOr3f6vqFCTeIWk3x/7j6VQ284VT7H+zDpfAFtOV5evPJeiEUb X8QKK49zJz/eUc5Fv0ywMS0x+DNzxchJbwcuCfNUceZStE2vG03D9B5Ttzl2+SyHqT5u dAdg== X-Gm-Message-State: AE9vXwOyg7ogFdreLDMHclgDPt5tkxoVp03l578i3C13lUn1dEeVDa+ZY4GhcNmG9JXO0w== X-Received: by 10.98.17.83 with SMTP id z80mr5253951pfi.38.1473864517957; Wed, 14 Sep 2016 07:48:37 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net ([2601:647:5000:6620:3862:3238:dafb:7d5f]) by smtp.gmail.com with ESMTPSA id k80sm710142pfk.27.2016.09.14.07.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 07:48:37 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, tglx@linutronix.de, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org Subject: [PATCH v5 2/5] fs: proc: Delete inode time initializations in proc_alloc_inode() Date: Wed, 14 Sep 2016 07:48:03 -0700 Message-Id: <1473864486-30862-3-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473864486-30862-1-git-send-email-deepa.kernel@gmail.com> References: <1473864486-30862-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP proc uses new_inode_pseudo() to allocate a new inode. This in turn calls the proc_inode_alloc() callback. But, at this point, inode is still not initialized with the super_block pointer which only happens just before alloc_inode() returns after the call to inode_init_always(). Also, the inode times are initialized again after the call to new_inode_pseudo() in proc_inode_alloc(). The assignemet in proc_alloc_inode() is redundant and also doesn't work after the current_time() api is changed to take struct inode* instead of struct *super_block. This bug was reported after current_time() was used to assign times in proc_alloc_inode(). Signed-off-by: Deepa Dinamani Reported-by: Fengguang Wu [0-day test robot] Reviewed-by: Arnd Bergmann --- fs/proc/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index c1b7238..ce1f1a9 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -68,7 +68,6 @@ static struct inode *proc_alloc_inode(struct super_block *sb) ei->sysctl_entry = NULL; ei->ns_ops = NULL; inode = &ei->vfs_inode; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; return inode; }