From patchwork Fri Mar 8 14:12:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 226130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 60E252C03BB for ; Sat, 9 Mar 2013 01:12:20 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UDy1p-0006MH-Lz; Fri, 08 Mar 2013 14:12:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UDy1k-0006Lx-Dp for kernel-team@lists.ubuntu.com; Fri, 08 Mar 2013 14:12:04 +0000 Received: from 79-78-211-70.dynamic.dsl.as9105.com ([79.78.211.70] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UDy1k-0004ki-6V; Fri, 08 Mar 2013 14:12:04 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: ubuntu: overlayfs -- fix missmerge of vfs_open changes Date: Fri, 8 Mar 2013 14:12:01 +0000 Message-Id: <1362751921-4977-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362751921-4977-1-git-send-email-apw@canonical.com> References: <1362751921-4977-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com Quantal is based on v3.5 which sits at an unfortuanate juncture in the evolution of the open code. At this specific time there is an open coded side effect (see below) on the success path for the calls do_dentry_open(). When injecting the vfs_open (again open coded) into the nameidata_to_filp() routine to avoid the success path reference counting issues, this side effect was lost. Re-add this to avoid panics: nd->intent.open.file = NULL; BugLink: http://bugs.launchpad.net/bugs/1122094 BugLink: http://bugs.launchpad.net/bugs/1147678 Signed-off-by: Andy Whitcroft Acked-by: Leann Ogasawara --- fs/open.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/open.c b/fs/open.c index a500c82..97b46a3 100644 --- a/fs/open.c +++ b/fs/open.c @@ -833,8 +833,13 @@ struct file *nameidata_to_filp(struct nameidata *nd) struct file *res; struct inode *inode = nd->path.dentry->d_inode; - if (inode->i_op->open) - return inode->i_op->open(nd->path.dentry, filp, cred); + if (inode->i_op->open) { + res = inode->i_op->open(nd->path.dentry, filp, cred); + if (!IS_ERR(res)) { + nd->intent.open.file = NULL; + } + return res; + } res = do_dentry_open(&nd->path, filp, NULL, cred); if (!IS_ERR(res)) {