From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f195.google.com ([209.85.213.195]:33866 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754319AbeEaKYw (ORCPT ); Thu, 31 May 2018 06:24:52 -0400 MIME-Version: 1.0 In-Reply-To: <05f230c2-5bda-79d3-6838-7e9458c7dbf5@acentic.com> References: <20180516104430.1191-1-henry.wilson@acentic.com> <20180530102613.1194-1-henry.wilson@acentic.com> <20180530130136.uaj7akyuyp44mg3c@quack2.suse.cz> <470ddceb-fa27-7467-c6ad-1aca4c551432@acentic.com> <20180530160427.qs2dykrx3ohqm3bf@quack2.suse.cz> <05f230c2-5bda-79d3-6838-7e9458c7dbf5@acentic.com> From: Amir Goldstein Date: Thu, 31 May 2018 13:24:51 +0300 Message-ID: Subject: Re: [PATCH v3 4.17] inotify: Add flag IN_EXCL_ADD for inotify_add_watch() To: Henry Wilson Cc: Jan Kara , linux-fsdevel , linux-api@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, May 31, 2018 at 11:22 AM, Henry Wilson wrote: > > > On 30/05/18 17:04, Jan Kara wrote: >> >> On Wed 30-05-18 18:40:27, Amir Goldstein wrote: >>> >>> On Wed, May 30, 2018 at 4:35 PM, Henry Wilson >>> wrote: >>>> >>>> On 30/05/18 14:01, Jan Kara wrote: >>>>> >>>>> >>>>> Thanks. The patch looks good. I've added it to my tree. BTW, do you >>>>> plan >>>>> on >>>>> working on a similar addition to fanotify? >>>>> >>>>> Honza >>>>> >>>> >>>> Ah that's grand, I'm glad to have helped to improve things. >>>> I'm not familiar with fanotify, however a quick look at fanotify_user.c >>>> suggests that a similar approach may be taken by modifying: >>>> >>>> if(!fsn_mark) { >>>> ... >>>> } >>>> else if (create) { >>>> return -EEXIST; >>>> } >>>> >>>> in both fanotify_add_vfsmount_mark() and fanotify_add_inode_mark() >>>> >>> >>> I think that was a yes/no question and I interpret your answer as no?? >> >>> Anyway, another yes/no question: >>> Can you write a simple LTP test to verify the new API? > > > I shall have a go at writing a test, yes. Great. I advice you start by forking testcases/kernel/syscalls/inotify/inotify01.c I would verify that: A. IN_MASK_CREATE creates a watch and events get generated (minor flavor of inotify01.c) B. IN_MASK_CREATE returns EEXISTS on second call for same file C. existing mask is not modified by this attempt (events get generated according to original mask) D. IN_MASK_CREATE && IN_MASK_ADD return EINVAL B-D. can be just extra steps in setup(). Do keep in mind to exit test with tst_brk(TCONF in case call with IN_MASK_CREATE returns EINVAL > >>> >>> I reccon Jan was also expecting an actual patch posted to man pages >>> maintainer (and linux-api, which was not cc'ed on the latest patch). > > > Ah, I did not know linux-api needed to be cc'ed in. > >> >> Yes, and I think Henry is about to post it, just didn't get to it yet. > > > For reference here is an archive link to the thread on the linux-man archive > https://marc.info/?l=linux-man&m=152769572917930&w=2 > OK, so I see now with the flag name change documentation patch is out of date, but also the statement (since Linux 4.17) is incorrect Honestly, I don't know how Michael coordinates man pages updates vs. merged kernel patches, but the more info you provide to Michael about were the kernel patch stands in the process is probably for the best. Thanks, Amir.