From patchwork Tue May 29 14:43:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10436035 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 2FAF360327 for ; Tue, 29 May 2018 15:08:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2154E286BF for ; Tue, 29 May 2018 15:08:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1627C287A0; Tue, 29 May 2018 15:08:28 +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 C3442286BF for ; Tue, 29 May 2018 15:08:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936531AbeE2PEE (ORCPT ); Tue, 29 May 2018 11:04:04 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52316 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936412AbeE2Oo3 (ORCPT ); Tue, 29 May 2018 10:44:29 -0400 Received: by mail-wm0-f66.google.com with SMTP id 18-v6so35805534wml.2 for ; Tue, 29 May 2018 07:44:29 -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=NSaXDfnuapmVPt7tNfYltTcZBSiN/oH5ZUrh0jBehf9a7kHQZmh5fDAg8DNc2pudL7 S/XDs4w63fhK3WvBn0fN1h8y77BO/My/QdZvLJbYG0jzS4yDQc+VQj2P0DVwv9SeoI56 nM7Q4CWf/XpKGhxh9IfHD7R1Zut5plJqB546OUfmyRkjRNXu0x1vL5vhguycyMNK9Kfm oPmnfsJ7TbPv6fGRfY77zE+8f+JEfHryjNpQIhuqUFrLQ94VS8EMDqc+q9bfHm3FJMcR OeLaFG/aIxZogdquUq7KDOp3SijgNu9IT+0L+C6bPZwL/AAs/Mh6dLIpkv6IZ4qNFc4H sQFg== X-Gm-Message-State: ALKqPwe5iwI642lrqiclcoiURImaDz7scX/kaRHkZipdGlop9Je/r5aY oKQDDDZYbW47Xxb29CsZPZpX1IGtnps= X-Google-Smtp-Source: ADUXVKIasoaZEjDPk9LqG1Jv6FZOJf7qUmg8qxy407xYMA5qNp41UELxJdbyENX17MNcxCBaC5xUeg== X-Received: by 2002:a1c:8a03:: with SMTP id m3-v6mr10497264wmd.135.1527605068387; Tue, 29 May 2018 07:44:28 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id t198-v6sm18834422wmt.23.2018.05.29.07.44.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:44:27 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 38/39] Revert "fsnotify: support overlayfs" Date: Tue, 29 May 2018 16:43:38 +0200 Message-Id: <20180529144339.16538-39-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144339.16538-1-mszeredi@redhat.com> References: <20180529144339.16538-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;