All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>, Jan Kara <jack@suse.cz>,
	Eric Paris <eparis@parisplace.org>,
	John McCutchon <john@johnmccutchan.com>,
	Robert Love <rlove@rlove.org>
Subject: Re: [PATCH 1/1] truncate: generate fanotify and inotify events
Date: Sat, 4 Oct 2014 00:43:59 +0300	[thread overview]
Message-ID: <20141003214359.GA19171@node.dhcp.inet.fi> (raw)
In-Reply-To: <1412371996-1265-1-git-send-email-xypron.glpk@gmx.de>

On Fri, Oct 03, 2014 at 11:33:16PM +0200, Heinrich Schuchardt wrote:
> The fanotify and the inotify API can be used to monitor changes of the file
> system.
> 
> System call truncate modifies files. Hence it should trigger the corresponding
> fanotify and inotify events.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  fs/open.c                |  5 +++
>  include/linux/fsnotify.h | 87 ++++++++++++++++++++++++++++++++----------------
>  security/security.c      |  7 +++-
>  3 files changed, 70 insertions(+), 29 deletions(-)
> 
> diff --git a/fs/open.c b/fs/open.c
> index d6fd3ac..be45e58 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -104,12 +104,17 @@ long vfs_truncate(struct path *path, loff_t length)
>  	if (!error)
>  		error = security_path_truncate(path);
>  	if (!error)
> +		fsnotify_open_path(path);
>  		error = do_truncate(path->dentry, length, 0, NULL);

This is obviously broken.

-- 
 Kirill A. Shutemov

      reply	other threads:[~2014-10-03 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 21:33 [PATCH 1/1] truncate: generate fanotify and inotify events Heinrich Schuchardt
2014-10-03 21:43 ` Kirill A. Shutemov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141003214359.GA19171@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=eparis@parisplace.org \
    --cc=jack@suse.cz \
    --cc=james.l.morris@oracle.com \
    --cc=john@johnmccutchan.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=rlove@rlove.org \
    --cc=serge@hallyn.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.