From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122AbaDMO27 (ORCPT ); Sun, 13 Apr 2014 10:28:59 -0400 Received: from mout.gmx.net ([212.227.15.19]:58031 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbaDMO26 (ORCPT ); Sun, 13 Apr 2014 10:28:58 -0400 Message-ID: <534A9F22.4090902@gmx.de> Date: Sun, 13 Apr 2014 16:28:50 +0200 From: Heinrich Schuchardt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Andrew Morton CC: Eric Paris , Jan Kara , tvrtko.ursulin@onelan.co.uk, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] Avoid having to provide a fake/invalid fd and path (fanotify) References: <1395847805-6714-1-git-send-email-xypron.glpk@gmx.de> <20140326184731.GA18118@quack.suse.cz> <1395860454.24733.15.camel@flatline.rdu.redhat.com> In-Reply-To: <1395860454.24733.15.camel@flatline.rdu.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:YoaHEloej29VcgUN4nroNcy0jt/nmLqJQCkzA+tks2WibxnL1ML c4S81fCkVMFlW1l4mix6MKOGrmUL9icHbMJTREXPNRvAwt+1JPLrNHHGCCAHrZk1XfSXGaf yYRzgZRBFCYH/SNzUBNygLsp7VAXZiW+TieTooSNaP4OxpMVs+dxO4whu+zzaRaGhKaTS81 xD6MO1FtUBRGLOlkrh6Xg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andrew, may I again bring this patch to your attention. Jan Kara reviewed it and fanotify maintainer Eric Paris asked you to, please, apply it. Unfortunately I could not see any update. Best regards Heinrich Schuchardt On 26.03.2014 20:00, Eric Paris wrote: > On Wed, 2014-03-26 at 19:47 +0100, Jan Kara wrote: >> On Wed 26-03-14 16:30:05, xypron.glpk@gmx.de wrote: >>> From: Heinrich Schuchardt >>> >>> https://lkml.org/lkml/2011/1/12/112 >>> holds a patch by Tvrtko Ursulin >>> >>> Avoid having to provide a fake/invalid fd and path when flushing marks >>> >>> Currently for a group to flush marks it has set it needs to >>> provide a fake or invalid (but resolvable) file descriptor >>> and path when calling fanotify_mark. This patch pulls the >>> flush handling a bit up so file descriptor and path are >>> completely ignored when flushing. >>> >>> Eric wrote it was applied. >>> https://lkml.org/lkml/2011/1/19/321 >>> >>> Unfortunately it is still not in the main stream code and the problem remains. >>> >>> I reworked the patch to be applicable again (the signature of fanotify_mark >>> has changed since Tvrtko's work). >>> >>> Signed-off-by: Heinrich Schuchardt >> The patch looks good to me. You can add: >> Reviewed-by: Jan Kara >> >> Andrew, can you please add the patch to the fanotify patches you already >> carry? Thanks! > > Acked-by: Eric Paris > > that would be great Andrew! > >> >> Honza >> >>> --- >>> fs/notify/fanotify/fanotify_user.c | 17 ++++++++++------- >>> 1 file changed, 10 insertions(+), 7 deletions(-) >>> >>> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c >>> index 287a22c..05bb38a 100644 >>> --- a/fs/notify/fanotify/fanotify_user.c >>> +++ b/fs/notify/fanotify/fanotify_user.c >>> @@ -856,6 +856,15 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, >>> group->priority == FS_PRIO_0) >>> goto fput_and_out; >>> >>> + if (flags & FAN_MARK_FLUSH) { >>> + ret = 0; >>> + if (flags & FAN_MARK_MOUNT) >>> + fsnotify_clear_vfsmount_marks_by_group(group); >>> + else >>> + fsnotify_clear_inode_marks_by_group(group); >>> + goto fput_and_out; >>> + } >>> + >>> ret = fanotify_find_path(dfd, pathname, &path, flags); >>> if (ret) >>> goto fput_and_out; >>> @@ -867,7 +876,7 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, >>> mnt = path.mnt; >>> >>> /* create/update an inode mark */ >>> - switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_FLUSH)) { >>> + switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { >>> case FAN_MARK_ADD: >>> if (flags & FAN_MARK_MOUNT) >>> ret = fanotify_add_vfsmount_mark(group, mnt, mask, flags); >>> @@ -880,12 +889,6 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, >>> else >>> ret = fanotify_remove_inode_mark(group, inode, mask, flags); >>> break; >>> - case FAN_MARK_FLUSH: >>> - if (flags & FAN_MARK_MOUNT) >>> - fsnotify_clear_vfsmount_marks_by_group(group); >>> - else >>> - fsnotify_clear_inode_marks_by_group(group); >>> - break; >>> default: >>> ret = -EINVAL; >>> } >>> -- >>> 1.7.10.4 >>> > > >