All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jan Kara <jack@suse.cz>, Eric Paris <eparis@parisplace.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	John McCutchan <john@johnmccutchan.com>,
	Robert Love <rlove@rlove.org>
Subject: Re: [PATCH 1/1] ftruncate: create FAN_MODIFY and IN_MODIFY events
Date: Mon, 6 Oct 2014 15:24:49 +0200	[thread overview]
Message-ID: <20141006132449.GD7526@quack.suse.cz> (raw)
In-Reply-To: <1412360190-1507-1-git-send-email-xypron.glpk@gmx.de>

On Fri 03-10-14 20:16:30, Heinrich Schuchardt wrote:
> The fanotify and the inotify API can be used to monitor changes of the file
> system.
> 
> System call ftruncate modifies files. Hence it should trigger the corresponding
> fanotify (FAN_MODIFY) and inotify (IN_MODIFY) events.
  Hum, I would think that the appropriate event gets generated by
fsnotify_change() called from notify_change()?

								Honza
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  fs/open.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/open.c b/fs/open.c
> index d6fd3ac..e36f26e 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -189,6 +189,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
>  		error = security_path_truncate(&f.file->f_path);
>  	if (!error)
>  		error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, f.file);
> +	if (!error) 
> +		fsnotify_modify(f.file);
>  	sb_end_write(inode->i_sb);
>  out_putf:
>  	fdput(f);
> -- 
> 2.1.0
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-10-06 13:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 18:16 [PATCH 1/1] ftruncate: create FAN_MODIFY and IN_MODIFY events Heinrich Schuchardt
2014-10-06 13:24 ` Jan Kara [this message]
2014-10-06 20:09   ` Heinrich Schuchardt
2014-10-07 19:23     ` Jan Kara
2014-10-23 21:35       ` [PATCH v2 1/1] ftruncate, truncate: create fanotify events Heinrich Schuchardt
2014-11-10 20:30         ` Jan Kara
2014-11-10 23:10           ` Heinrich Schuchardt
2014-11-11  7:34           ` Christoph Hellwig
2014-11-11 11:09             ` Jan Kara
2014-11-11 19:55               ` Heinrich Schuchardt
2014-11-14 10:01                 ` Jan Kara
2014-11-14 21:30                   ` Heinrich Schuchardt

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=20141006132449.GD7526@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=eparis@parisplace.org \
    --cc=john@johnmccutchan.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=rlove@rlove.org \
    --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.