[CRIU] [PATCH 00/18] fanotify c/r, v3

Cyrill Gorcunov gorcunov at openvz.org
Fri Jan 11 11:58:01 EST 2013


Hi guys, here is and update to fanotify series. I've tried to
address comments obtained on previous submission. Here is a delta

 - proc_parse routine has been reworked and simplified I hope
 - @wd entry remains solely for watch descriptor, for mark
   flags I introduced mflags field
 - read data verification path re-staged to be applied earlier than
   real fanotify data get read

Now, what I've left untouched (comments from xemul@)

 | Patch: fsnotify: Add try_open_handle helper
 |
 | This does more than just split one fn into two. Don't merge these
 | two changes in one patch.
 |
 | You moved piece of restore_one_fsnotify in try_open_handle and
 | in the same patch -- piece of try_open_handle inside one of the
 | if-s branches. Let's split these two changed into two patches.

	I must admit I still don't get it. The try_open_handle does
	exactly what it has been designed for -- tries to open a
	handle and provides back path and descriptor on success.
	Sure the code which uses this helper is changed.

 | Patch: fsnotify: Update open_fsnotify_fd to choose helper depending on notif type
 |
 | You have already renamed this fn in this set.

	The idea of series was exatly that -- at first we moved inotify.c|h
	files to fsnotify.ch and rename the functions to have fsnotify prefix.
	Then with small steps we unweave the things and fsnotify prefixed
	functions start calling fanotify/inotify helpers.

 | Patch: fsnotify: Extend protobuf format to keep notification type and specific parameters
 |
 | > +
 | > +	optional fsnotify_type	type		= 5;
 | > +	optional fanotify_glob	faglob		= 6;
 |
 | Do we _really_ need two fields for that? Why not
 |
 | if_fanotify(FsnotifyFileEntry *e)
 | {
 |	return e->faglob != NULL;
 | }
 |

	I found to have a separate @type field here a way more convenient
	for debug and readability purpose. That's why I used it.

Anyway, please take a look and comments, thanks!

Cyrill Gorcunov (18)
  fsnotify: Rename inotify files to fsnotify
  fsnotify: Rename inotify@ to fsnotify@ function names and structures
  fsnotify: Extend protobuf format to keep notification type and
    specific parameters
  fsnotify: inotify -- Add dumping of optional fields
  fsnotify: Add is_fanotify_link helper
  syscall: Add __NR_fanotify_init and __NR_fanotify_mark
  mount: Add lookup_mnt_id and lookup_mnt_sdev helpers
  fsnotify: Add try_open_handle helper
  fsnotify: Move debug printing into try_open_handle
  fsnotify: Update open_fsnotify_fd to choose helper depending on notif
    type
  fsnotify: Add verification of read data
  fsnotify: Add fanotify restore
  dump: Collect mount information on dump
  proc_parse: Add parsing of fanotify entries
  dump: Add dumping of fanotify objects
  fsnotify: inotify -- Add FIXME about disabling events
  fsnotify: Don't foget to put ref of remap object on error path
  zdtm: Add fanotify00 test

 Makefile                           |   2 +-
 arch/x86/syscall-x86-64.def        |   2 +
 cr-check.c                         |  10 +-
 cr-dump.c                          |   7 +-
 cr-restore.c                       |   4 +-
 fsnotify.c                         | 518 +++++++++++++++++++++++++++++++++++++
 image.c                            |   6 +-
 include/crtools.h                  |   4 +-
 include/fsnotify.h                 |  26 ++
 include/image.h                    |   4 +-
 include/inotify.h                  |  18 --
 include/mount.h                    |   4 +
 include/proc_parse.h               |   4 +-
 include/protobuf.h                 |   4 +-
 inotify.c                          | 261 -------------------
 mount.c                            |  20 +-
 proc_parse.c                       | 135 +++++++---
 protobuf.c                         |   6 +-
 protobuf/Makefile                  |   2 +-
 protobuf/fdinfo.proto              |   2 +-
 protobuf/fsnotify.proto            |  42 +++
 protobuf/inotify.proto             |  18 --
 test/zdtm.sh                       |   1 +
 test/zdtm/live/static/Makefile     |   1 +
 test/zdtm/live/static/fanotify00.c | 110 ++++++++
 25 files changed, 855 insertions(+), 356 deletions(-)
 create mode 100644 fsnotify.c
 create mode 100644 include/fsnotify.h
 delete mode 100644 include/inotify.h
 delete mode 100644 inotify.c
 create mode 100644 protobuf/fsnotify.proto
 delete mode 100644 protobuf/inotify.proto
 create mode 100644 test/zdtm/live/static/fanotify00.c

-- 
1.8.0.1


More information about the CRIU mailing list