Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1853342ybm; Thu, 23 May 2019 07:42:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhiPD1mUjhFWE6TsECSVkTl2MFNbMdpamrdviV1xCRczagkuFQ9kM6k6K/z0WX6AuhP+pI X-Received: by 2002:a62:d286:: with SMTP id c128mr105049322pfg.159.1558622551377; Thu, 23 May 2019 07:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558622551; cv=none; d=google.com; s=arc-20160816; b=DgQbY4vK0inZjqeD6ktNAXqnA08uQxJHPGc5LdIvOeil3929INA0GXFllo26pQYvB8 qamy2EVz7NiDQH00Sku807DOjVpw/Lxs3Vh2IU8jsjX+rfxKXkQzhTHGQRjvhShl3mih ie4ygCB8CYp0Rq4M74xJecD8WsP+mvVty8MqHX//bUTWWZ/LBBnT04OvegQH1d9gMZse m7n7VkMtnTBcmYZXRyMZONkGpRZOUBsf3qSelLDr204USTibfLHcZdqBwH3sqTGioYSh aXnesPmHOckdBd5fGuhuVsBhr4bVaSJRt4hxj5HHaLs4OCKrWAir4R8Q+DZk93vqwvdj vgMA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XRh+d5924Dg1mcrWBNstrCi+yAJXyfZQu7htxMEZC0U=; b=F2ZMOTXE7LB3YPrRBZrcaGD1uCktl024HRj/B9Vj0EFbE3zQHjTl3hwLEBQlNibmVe 3+N98dJqnId/aVVOk2FNM1dTzyNq5QbfFgnHWoxEbcC1TKwibIofh2qc7QKD9XLNCOml 0T+SAM4uGoyLcBxM7O1NR5bbFB13kUqo56UrzswSx8EZ0tCbUw7/A9D9Uvxibt4pNizf PE7DxbjESMspf35U186ONJCKX9ofo5lOFmkQAT09QgiirHUaKM9KS7sZvrkJG2TIsacH qTH6HtLAMuefVTw65MZANDjbe+mHnTRoSV//VsuzPe1dOiq2Mo1vJj6RC8lEyTtcgopI BGRg== 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 r6si1860739pgp.75.2019.05.23.07.42.13; Thu, 23 May 2019 07:42:31 -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 S1730867AbfEWOkw (ORCPT + 99 others); Thu, 23 May 2019 10:40:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:60286 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730708AbfEWOkv (ORCPT ); Thu, 23 May 2019 10:40:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9AEBFAE4E; Thu, 23 May 2019 14:40:50 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 350351E3C69; Thu, 23 May 2019 16:40:50 +0200 (CEST) Date: Thu, 23 May 2019 16:40:50 +0200 From: Jan Kara To: Christian Brauner Cc: Amir Goldstein , Jan Kara , linux-fsdevel , linux-kernel , Matthew Bobrowski Subject: Re: [PATCH] fanotify: remove redundant capable(CAP_SYS_ADMIN)s Message-ID: <20190523144050.GE2949@quack2.suse.cz> References: <20190523095506.nyei5nogvv63lm4a@brauner.io> <20190523104239.u63u2uth4yyuuufs@brauner.io> <20190523115845.w7neydaka5xivwyi@brauner.io> <20190523133516.6734wclswqr6vpeg@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523133516.6734wclswqr6vpeg@brauner.io> 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 23-05-19 15:35:18, Christian Brauner wrote: > So let's say the user tells me: > - When the "/A/B/C/target" file appears on the host filesystem, > please give me access to "target" in the container at a path I tell > you. > What I do right now is listen for the creation of the "target" file. > But at the time the user gives me instructions to listen for > "/A/B/C/target" only /A might exist and so I currently add a watch on A/ > and then wait for the creation of B/, then wait for the creation of C/ > and finally for the creation of "target" (Of course, I also need to > handle B/ and C/ being removed again an recreated and so on.). It would > be helpful, if I could specify, give me notifications, recursively for > e.g. A/ without me having to place extra watches on B/ and C/ when they > appear. Maybe that's out of scope... I see. But this is going to be painful whatever you do. Consider for example situation like: mkdir -p BAR/B/C/ touch BAR/B/C/target mv BAR A Or even situation where several renames race so that the end result creates the name (or does not create it depending on how renames race). And by the time you decide A/B/C/target exists, it doesn't need to exist anymore. Honestly I don't see how you want to implement *any* solution in a sane way. About the most reliable+simple would seem to be stat "A/B/C/target" once per second as dumb as it is. Honza -- Jan Kara SUSE Labs, CR