From patchwork Mon May 7 08:38:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383485 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 8A52F60353 for ; Mon, 7 May 2018 08:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 813FD28B4B for ; Mon, 7 May 2018 08:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 761BA28B24; Mon, 7 May 2018 08:42:14 +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 2B65628B4F for ; Mon, 7 May 2018 08:42:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223AbeEGIkt (ORCPT ); Mon, 7 May 2018 04:40:49 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54192 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbeEGIiv (ORCPT ); Mon, 7 May 2018 04:38:51 -0400 Received: by mail-wm0-f65.google.com with SMTP id a67so11990215wmf.3 for ; Mon, 07 May 2018 01:38:50 -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=0tjAoGR4CIwwPW5VxPRU0Sp29z7kDXYKHmwEOnXSv/E=; b=V8HoZP7XakUCfe1KaEUxoqR7eF3hG0YCxT6d5Idyd7uV7xJQ33u/0r3dRuxLHwJz7n a5BXQtqMi9ipWKMAm2N7W96fRR6ZMoD/PzdLxf1P0bJse2RQqrlI5uZbGaaPGqZs/idK EjDElmvi7Y5p5BStN0AlLXFAjVkWIDcCga3Y1sqr9zIjBn5rAzF2sgIwzcTveQDkUaCe BVdUbazYsE3Dxksf4uV3B/XEeZvcZX3SpPO5vpf0WmoA+RfpIs+dBS9k2SFeBnBT3SSB eh8xO837KyhGuAcIJJr5iJOK2a0nDxLsr2L2ggeznB0It96S1BlsGCoZ80kZP5d36z7n U3KQ== X-Gm-Message-State: ALKqPwfLRk4atoNps8fYFg/DdvO+fb6YzqHNo0zUlxHryapP6n2JwKEW uswcMY0vGYFsAHRw88n7Au25WA== X-Google-Smtp-Source: AB8JxZrrhNVpFj+OdAeISbrRPM2O4Ra03x+AA0IgCx/2AShncX7vQ+Vxj9Ocw7g1plMfJiVjjNsTyQ== X-Received: by 2002:a1c:512:: with SMTP id 18-v6mr157051wmf.47.1525682329984; Mon, 07 May 2018 01:38:49 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:49 -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 33/35] Revert "fsnotify: support overlayfs" Date: Mon, 7 May 2018 10:38:05 +0200 Message-Id: <20180507083807.28792-34-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 f3fbbb079263bd29ae592478de6808db7e708267. Overlayfs now works correctly without adding hacks to fsnotify. Signed-off-by: Miklos Szeredi --- include/linux/fsnotify.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index bdaf22582f6e..fd1ce10553bf 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -30,11 +30,7 @@ static inline int fsnotify_parent(const struct path *path, struct dentry *dentry static inline int fsnotify_perm(struct file *file, int mask) { const struct path *path = &file->f_path; - /* - * Do not use file_inode() here or anywhere in this file to get the - * inode. That would break *notity on overlayfs. - */ - struct inode *inode = path->dentry->d_inode; + struct inode *inode = file_inode(file); __u32 fsnotify_mask = 0; int ret; @@ -178,7 +174,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) static inline void fsnotify_access(struct file *file) { const struct path *path = &file->f_path; - struct inode *inode = path->dentry->d_inode; + struct inode *inode = file_inode(file); __u32 mask = FS_ACCESS; if (S_ISDIR(inode->i_mode)) @@ -196,7 +192,7 @@ static inline void fsnotify_access(struct file *file) static inline void fsnotify_modify(struct file *file) { const struct path *path = &file->f_path; - struct inode *inode = path->dentry->d_inode; + struct inode *inode = file_inode(file); __u32 mask = FS_MODIFY; if (S_ISDIR(inode->i_mode)) @@ -214,7 +210,7 @@ static inline void fsnotify_modify(struct file *file) static inline void fsnotify_open(struct file *file) { const struct path *path = &file->f_path; - struct inode *inode = path->dentry->d_inode; + struct inode *inode = file_inode(file); __u32 mask = FS_OPEN; if (S_ISDIR(inode->i_mode)) @@ -230,7 +226,7 @@ static inline void fsnotify_open(struct file *file) static inline void fsnotify_close(struct file *file) { const struct path *path = &file->f_path; - struct inode *inode = path->dentry->d_inode; + struct inode *inode = file_inode(file); fmode_t mode = file->f_mode; __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;