Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1603546imm; Fri, 7 Sep 2018 03:10:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY2xtFtXTYd1l6twNEwGcTUFmg/lJFxp1tUxmCMMIKzHk9bIts1rZc6HR1cGUxv04NTOfF/ X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr7205076plb.110.1536315025299; Fri, 07 Sep 2018 03:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536315025; cv=none; d=google.com; s=arc-20160816; b=kRdPKhVhbzaQMbLzQDO+8ZRTlnTO76OWwU4Q2tI/ZMImqfwaKqsRSKV+hfahJfZ1kb ghTZ/gb+6JxMJoE4S83MNlVLJpJ0fgEhh4CfRlGOOVkDNr846yXdzIuFrULCwA+Dil25 iX26Sjq1BySSz+9QnZ8LnVf8WT/9H0pbzeMRxjaA8oRqkAgqdRU282Fx87DV90G1geMr JYNXrPrT9VQmlL15JiAzN+ibTWZkkRSAcAfA1Axx/j5sLRT3hYuJtO0rODqZf0Xtvk4V 7G4kstw1sLdO3+pCmCVDtUxJB0PonJClauLpHoCdIZDCbgXACFv7bI4gIr3ghgrHicl4 UXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SmXEyIBV+DEtPebQohRknE08aYpZWwsHIGiinhZheFg=; b=gtnI6UXZMg4B4Jov+LkAo4KMS4TyLXGwD6oB/BirTRVtne/Dx+ZaethZqhM6Kskd1w 2z+8eLUC2vLr02tbPy2TgBm6DzxWQK6TqKpEkgrjDGxEDciNlrg77pPRU7qpaRlVarsU 0OD4PXzUY9tpPslcegm+O2ouJ6Z9HdBs61mYPA0+ybYk5VWdWrgtSdxWcBfffjyqx32f oC6CJy70W3LxvTgv8VBdnk0z7t/NkAthrG86V+GMUbSeOyGn5fF4Ie7z0/X9Fy1Ay/nA E88BSInxpIPtxQ05VbLJX42FuWXXOf/IdRW8GcDgnzYrh9XLASZh/hoLHORPgPpsLRZe ZapA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si7192146plp.335.2018.09.07.03.10.09; Fri, 07 Sep 2018 03:10:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbeIGObq (ORCPT + 99 others); Fri, 7 Sep 2018 10:31:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44360 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726031AbeIGObq (ORCPT ); Fri, 7 Sep 2018 10:31:46 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 901BFEE6; Fri, 7 Sep 2018 09:51:35 +0000 (UTC) Date: Fri, 7 Sep 2018 11:51:32 +0200 From: Greg KH To: Mark Salyzyn Cc: stable , kernel , Amir Goldstein , Miklos Szeredi Subject: Re: ovl: hash non-dir by lower inode for fsnotify Message-ID: <20180907095132.GC13327@kroah.com> References: <2630a5c0-ef57-a4cf-a6f4-b4996c64043b@android.com> <20180802060549.GB3272@kroah.com> <8c38c2fc-36e6-9aa7-5924-51d7bc2c3d73@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8c38c2fc-36e6-9aa7-5924-51d7bc2c3d73@android.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 02, 2018 at 08:29:02AM -0700, Mark Salyzyn wrote: > On 08/01/2018 11:05 PM, Greg KH wrote: > > On Wed, Aug 01, 2018 at 02:29:01PM -0700, Mark Salyzyn wrote: > > > 764baba80168ad3adafb521d2ab483ccbc49e344 ovl: hash non-dir by lower inode > > > for fsnotify is not part of 4.14 stable and yet it was marked for 4.13 > > > stable merge when committed. > > > > > > Please evaluate. > > Why not try applying it yourself to 4.14.y and note that it does not > > apply at all and then provide a working backport so that we can skip at > > least one email cycle here? :) > > > > thanks, > > > > greg k-h > > Because I am embarrassed by the backport (!) perhaps? :-) > > +linux-kernel list and authors/approvers for clearance. > > I took some liberty with sb = dentry_d_sb and then sprinkled it in, upstream > passes sb to the function and the conflicts assumed so. > > --------------------------> snip <------------------------- > > From 764baba80168ad3adafb521d2ab483ccbc49e344 Mon Sep 17 00:00:00 2001 > From: Amir Goldstein > Date: Sun, 4 Feb 2018 15:35:09 +0200 > Subject: ovl: hash non-dir by lower inode for fsnotify > > (cherry pick from commit 764baba80168ad3adafb521d2ab483ccbc49e344) > > Commit 31747eda41ef ("ovl: hash directory inodes for fsnotify") > fixed an issue of inotify watch on directory that stops getting > events after dropping dentry caches. > > A similar issue exists for non-dir non-upper files, for example: > > $ mkdir -p lower upper work merged > $ touch lower/foo > $ mount -t overlay -o > lowerdir=lower,workdir=work,upperdir=upper none merged > $ inotifywait merged/foo & > $ echo 2 > /proc/sys/vm/drop_caches > $ cat merged/foo > > inotifywait doesn't get the OPEN event, because ovl_lookup() called > from 'cat' allocates a new overlay inode and does not reuse the > watched inode. > > Fix this by hashing non-dir overlay inodes by lower real inode in > the following cases that were not hashed before this change: > ?- A non-upper overlay mount > ?- A lower non-hardlink when index=off > > A helper ovl_hash_bylower() was added to put all the logic and > documentation about which real inode an overlay inode is hashed by > into one place. > > The issue dates back to initial version of overlayfs, but this > patch depends on ovl_inode code that was introduced in kernel v4.13. > > Signed-off-by: Amir Goldstein > Signed-off-by: Miklos Szeredi > Cc: #v4.13 > Signed-off-by: Mark Salyzyn #v4.14 > --- > ?fs/overlayfs/inode.c | 62 +++++++++++++++++++++++++++++++------------- > ?1 file changed, 44 insertions(+), 18 deletions(-) > > diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c > index 28a320464609a..7cfef4152e9a4 100644 > --- a/fs/overlayfs/inode.c > +++ b/fs/overlayfs/inode.c > @@ -14,6 +14,7 @@ > ?#include > ?#include > ?#include "overlayfs.h" > +#include "ovl_entry.h" > > ?int ovl_setattr(struct dentry *dentry, struct iattr *attr) > ?{ > @@ -608,39 +609,63 @@ static bool ovl_verify_inode(struct inode *inode, > struct dentry *lowerdentry, As this patch is deemed "good", can you please resend it in a non-corrupted way so that I can apply it to the 4.14.y tree? thanks, greg k-h