linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ftruncate: create FAN_MODIFY and IN_MODIFY events
@ 2014-10-03 18:16 Heinrich Schuchardt
  2014-10-06 13:24 ` Jan Kara
  0 siblings, 1 reply; 12+ messages in thread
From: Heinrich Schuchardt @ 2014-10-03 18:16 UTC (permalink / raw)
  To: Alexander Viro
  Cc: linux-fsdevel, linux-kernel, Jan Kara, Eric Paris,
	Michael Kerrisk, John McCutchan, Robert Love,
	Heinrich Schuchardt

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.

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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-14 21:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).