linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jan Kara <jack@suse.cz>, Eric Paris <eparis@parisplace.org>,
	John McCutchan <john@johnmccutchan.com>,
	Robert Love <rlove@rlove.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [PATCH 1/1] fallocate: create FAN_MODIFY and IN_MODIFY events
Date: Fri,  3 Oct 2014 10:19:30 +0200	[thread overview]
Message-ID: <1412324370-959-1-git-send-email-xypron.glpk@gmx.de> (raw)
In-Reply-To: <1412287587-5392-1-git-send-email-xypron.glpk@gmx.de>

The fanotify and the inotify API can used to monitor changes of the file
system.

System call fallocate modifies files. Hence it should trigger the corresponding
fanotify (FAN_MODIFY) and inotify (IN_MODIFY) events.

This patch adds the missing call to fsnotify_modify.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 fs/open.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/open.c b/fs/open.c
index d6fd3ac..03aa8e5 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -295,6 +295,11 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 
 	sb_start_write(inode->i_sb);
 	ret = file->f_op->fallocate(file, mode, offset, len);
+
+	/* Create inotify and fanotify events. */
+	if (ret == 0)
+		fsnotify_modify(file);
+
 	sb_end_write(inode->i_sb);
 	return ret;
 }
-- 
2.1.0


       reply	other threads:[~2014-10-03  8:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1412287587-5392-1-git-send-email-xypron.glpk@gmx.de>
2014-10-03  8:19 ` Heinrich Schuchardt [this message]
2014-10-06 14:12   ` [PATCH 1/1] fallocate: create FAN_MODIFY and IN_MODIFY events Jan Kara
2014-10-06 19:10     ` Heinrich Schuchardt
2014-10-07 18:05       ` Jan Kara
2014-10-07 18:24         ` Heinrich Schuchardt
2014-10-14 22:43           ` Andrew Morton
2014-10-17 17:08             ` [PATCH v2 " 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=1412324370-959-1-git-send-email-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=eparis@parisplace.org \
    --cc=jack@suse.cz \
    --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 \
    /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 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).