From patchwork Mon May 7 08:37:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383477 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 3EE9160353 for ; Mon, 7 May 2018 08:41:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3495B28A96 for ; Mon, 7 May 2018 08:41:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 292C428B3E; Mon, 7 May 2018 08:41:55 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 C993A28A96 for ; Mon, 7 May 2018 08:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbeEGIk4 (ORCPT ); Mon, 7 May 2018 04:40:56 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33705 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbeEGIim (ORCPT ); Mon, 7 May 2018 04:38:42 -0400 Received: by mail-wr0-f193.google.com with SMTP id o4-v6so27842012wrm.0 for ; Mon, 07 May 2018 01:38:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XAqtlJKk0KFtCftADSZIIfBbqS7mvtSTKiWscehsItY=; b=Tg3RwaznUagdVpliEHmJwvs7Y5B+rAItmVlJEaQNku71u/cFAqnwjLrsOcfN49xfnv +66gpcqUGT6CG2MpLwkvnYOffSMlFpQMg1MWlMnsCW61t1BcEg8Nln2aOqIbHLLiSjHz v/jaf2F9SLuzU5ldxnz9Bw+D4GZB+4J4SP3N7HWpwcWgi2G8vsWE15r18Mq4yZQXgIFp ksNxP25yYwejmOAgmJKU8TVD3hUkS15o+EyOi+rqtvZ1+HDteaEfy3+dDHZQeGFapOAf tGoD2tk0Dml31UgX4WK5DPGiSmP3tqh48JabVLDu4eir+blsrqWRmvyz/pyl4C9Jgil9 q/gA== X-Gm-Message-State: ALQs6tBAWjqsX5lc6js5ZNcCBgbHhG4K/a8TU07vMENbRCMVw5IeJMDq qLVLMg0C5E52XBH2R2OHlJrCyQ== X-Google-Smtp-Source: AB8JxZorwZWKYv1JXuuqCZE+CHHs2Lv7VOz0lOySmS308Dn+ZzQmCrXm6Gfhq0yGN/ZsGJ3RcKg6SQ== X-Received: by 2002:adf:e64b:: with SMTP id b11-v6mr28352908wrn.51.1525682320940; Mon, 07 May 2018 01:38:40 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:40 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH v2 25/35] Revert "ovl: fix may_write_real() for overlayfs directories" Date: Mon, 7 May 2018 10:37:57 +0200 Message-Id: <20180507083807.28792-26-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-1-mszeredi@redhat.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 This reverts commit 954c736f865d6c0c68ae4263a2f3502ee7c447a3. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi --- fs/namespace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 5f75969adff1..c3f7152a8419 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -468,9 +468,7 @@ static inline int may_write_real(struct file *file) /* File refers to upper, writable layer? */ upperdentry = d_real(dentry, NULL, 0, D_REAL_UPPER); - if (upperdentry && - (file_inode(file) == d_inode(upperdentry) || - file_inode(file) == d_inode(dentry))) + if (upperdentry && file_inode(file) == d_inode(upperdentry)) return 0; /* Lower layer: can't write to real file, sorry... */