Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2016 02:23:58 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r299882 - in stable/10: lib/libc/sys sys/kern
Message-ID:  <201605160223.u4G2NwWL085957@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon May 16 02:23:58 2016
New Revision: 299882
URL: https://svnweb.freebsd.org/changeset/base/299882

Log:
  MFC r298922:
  Issue NOTE_EXTEND when a directory entry is added to or removed from
  the monitored directory as the result of rename(2) operation.  The
  renames staying in the directory are not reported.

Modified:
  stable/10/lib/libc/sys/kqueue.2
  stable/10/sys/kern/vfs_subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/sys/kqueue.2
==============================================================================
--- stable/10/lib/libc/sys/kqueue.2	Mon May 16 02:21:54 2016	(r299881)
+++ stable/10/lib/libc/sys/kqueue.2	Mon May 16 02:23:58 2016	(r299882)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 1, 2016
+.Dd May 2, 2016
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -368,7 +368,13 @@ was called on the file referenced by the
 .It Dv NOTE_WRITE
 A write occurred on the file referenced by the descriptor.
 .It Dv NOTE_EXTEND
-The file referenced by the descriptor was extended.
+For regular file, the file referenced by the descriptor was extended.
+.Pp
+For directory, reports that a directory entry was added or removed,
+as the result of rename operation.
+The
+.Dv NOTE_EXTEND
+event is not reported when a name is changed inside the directory.
 .It Dv NOTE_ATTRIB
 The file referenced by the descriptor had its attributes changed.
 .It Dv NOTE_LINK

Modified: stable/10/sys/kern/vfs_subr.c
==============================================================================
--- stable/10/sys/kern/vfs_subr.c	Mon May 16 02:21:54 2016	(r299881)
+++ stable/10/sys/kern/vfs_subr.c	Mon May 16 02:23:58 2016	(r299882)
@@ -4375,6 +4375,7 @@ vop_rename_post(void *ap, int rc)
 			VFS_KNOTE_UNLOCKED(a->a_fdvp, hint);
 			VFS_KNOTE_UNLOCKED(a->a_tdvp, hint);
 		} else {
+			hint |= NOTE_EXTEND;
 			if (a->a_fvp->v_type == VDIR)
 				hint |= NOTE_LINK;
 			VFS_KNOTE_UNLOCKED(a->a_fdvp, hint);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605160223.u4G2NwWL085957>