From patchwork Sat Jun 25 21:37:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9198713 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 047ED6077D for ; Sat, 25 Jun 2016 21:38:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE3F628527 for ; Sat, 25 Jun 2016 21:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0D732852B; Sat, 25 Jun 2016 21:38:27 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 5507B28527 for ; Sat, 25 Jun 2016 21:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbcFYVi0 (ORCPT ); Sat, 25 Jun 2016 17:38:26 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35560 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbcFYViW (ORCPT ); Sat, 25 Jun 2016 17:38:22 -0400 Received: by mail-pa0-f65.google.com with SMTP id hf6so11940410pac.2; Sat, 25 Jun 2016 14:38:21 -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=KoyWBs/tkpL/xm/0TJwBdXVLYmo3pCjuX65kn1JyIvQ=; b=rpU2Kf7X6mquDMzGccfDrEYmuqIKf7CtumBQH3hsm7apslFgBk/fVjVIKImdLDaub1 8xUCX4y/Mcj8owZNbuRIN3NyJK5sE8flB2QSIzXEo4X380q72sbTQTRVD+NdWb8Zqs02 tiGeL/1OvYwhMh7ZZOp2odMv7y9nWaTlH6apTMxfh2BI1vQM5WxUEYJ2nB9d61YiniKe HXx0Bpma0xE59NbWUhaO99W65cxpIEGilnzhyNlx9iHdymoiWvYql/QKLWZdTOjZ2T65 ix0Dz4TCK4CqBqoQVuXSDv5fD1vqqvBqM/f2zQirffYdqBnYFG278PK406F8rfGvUpD+ 0ibg== 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=KoyWBs/tkpL/xm/0TJwBdXVLYmo3pCjuX65kn1JyIvQ=; b=C0K1TsGvvFaqvdstk31P5POUfj6RCU58eIZWnIq4tn+yOx2F8ZJe2IDPJH/0uP5U/y ZfOY9XHYF4JMrudAxW8fWQCWeP1VX686hq7bBwG/H74xtET1fnGWWoliUqLlnXC/dvHv J0L0VSEUWGxWLscnoSiLqKYFxvVhZtCCC97SkmxwRlAd19/borZHSCbc01RSpnVM9abt cIK+i4veP5PsC+R1Mgeq7yl9uGBobPw0Wnika8EE50lNC9wVx1pOkbIzYEZ1XjDP+GX4 ALkO+00YBcJOLnn9d34SdkZ6r5QYfH9jSw/mY6qsm7USB0KUKgr33zMiGz5DRQW+WiZx Fu2A== X-Gm-Message-State: ALyK8tKp5QDf4Hp7NT+Oojz2drhHGjwUEA1k8wWfvyRKoiJnE9KfAMlGUgOEasoTIXh1ig== X-Received: by 10.66.4.106 with SMTP id j10mr19489380paj.111.1466890701469; Sat, 25 Jun 2016 14:38:21 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id m8sm1861308pfi.27.2016.06.25.14.38.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Jun 2016 14:38:21 -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, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org Subject: [PATCH v3 02/24] fs: proc: Delete inode time initializations in proc_alloc_inode() Date: Sat, 25 Jun 2016 14:37:26 -0700 Message-Id: <1466890668-23400-3-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> References: <1466890668-23400-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] --- fs/proc/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 6b1843e..606e4cd 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; }