linux-unionfs mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Jan Kara <jack@suse.cz>, Christian Brauner <brauner@kernel.org>,
	linux-unionfs@vger.kernel.org
Subject: [PATCH v2 0/4] Report overlayfs file ids with fanotify
Date: Thu, 13 Jul 2023 15:03:40 +0300	[thread overview]
Message-ID: <20230713120344.1422468-1-amir73il@gmail.com> (raw)

Miklos,

This is the second part of the work to support fanotify reporting of
events with file ids on overlayfs.  The fanotify_event_info_fid struct
reported with fanotify events has an object file handle and an fsid,
so fanotify requires that filesystems can encode file handles and have
a non-zero f_fsid.

The first part [1] that was merged to v6.5-rc1, relaxed the fanotify
requirements for filesystems to support reporting events with fid to
require only the ->encode_fh() export operation.

Patch 1 changes overlayfs export_operations to meet the new requirements
with the default overlay configurations (i.e. no need for nfs_export=on),
thus, allowing an fanotify watch with FAN_REPORT_FID on overlayfs.
There are LTS tests [2] for fanotify(FAN_REPORT_FID) + overlayfs.

Patches 2-4 are not strcitly needed to support reporting fanotify events
with fid, because overlayfs already reports a non-zero f_fsid, it's just
not a unique fsid.  So before allowing to report events with overlayfs
fids, I wanted to fix overlayfs fsid to be more unique.

I wanted to implement a persistent and unique fsid for overlayfs.
I wanted it to be the default behavior, but needed to avoid breaking
applications that rely on an existing overlayfs fsid to persist.
I came up with a solution that is described in patch 4 (uuid=auto) that
meets all the requirement above.
There is an xfstest to test the persistent-unique fsid feature [3].

This patch set has been in overlayfs-next for soaking since v6.5-rc1.
If you have any reservations that we will not be able to resolve in time
for 6.6, especially regarding the on-disk format and backward compat,
we could also merge only patch 1 and leave the fsid patches for later.

Thanks,
Amir.

[1] https://lore.kernel.org/linux-fsdevel/20230425130105.2606684-1-amir73il@gmail.com/
[2] https://github.com/amir73il/ltp/commits/ovl_encode_fid
[3] https://github.com/amir73il/xfstests/commits/ovl_fsid


Amir Goldstein (4):
  ovl: support encoding non-decodable file handles
  ovl: add support for unique fsid per instance
  ovl: store persistent uuid/fsid with uuid=on
  ovl: auto generate uuid for new overlay filesystems

 Documentation/filesystems/overlayfs.rst | 25 ++++++++++
 fs/overlayfs/copy_up.c                  |  2 +-
 fs/overlayfs/export.c                   | 26 ++++++++---
 fs/overlayfs/inode.c                    |  2 +-
 fs/overlayfs/namei.c                    |  5 +-
 fs/overlayfs/overlayfs.h                | 22 +++++++++
 fs/overlayfs/ovl_entry.h                |  3 +-
 fs/overlayfs/params.c                   | 31 +++++++++++--
 fs/overlayfs/super.c                    | 29 ++++++++++--
 fs/overlayfs/util.c                     | 61 +++++++++++++++++++++++++
 10 files changed, 186 insertions(+), 20 deletions(-)

-- 
2.34.1


             reply	other threads:[~2023-07-13 12:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 12:03 Amir Goldstein [this message]
2023-07-13 12:03 ` [PATCH v2 1/4] ovl: support encoding non-decodable file handles Amir Goldstein
2023-07-13 12:03 ` [PATCH v2 2/4] ovl: add support for unique fsid per instance Amir Goldstein
2023-07-13 12:03 ` [PATCH v2 3/4] ovl: store persistent uuid/fsid with uuid=on Amir Goldstein
2023-07-13 12:03 ` [PATCH v2 4/4] ovl: auto generate uuid for new overlay filesystems Amir Goldstein
2023-08-11  9:44 ` [PATCH v2 0/4] Report overlayfs file ids with fanotify Amir Goldstein
2023-08-11 13:20   ` Miklos Szeredi
2023-08-11 13:32     ` Amir Goldstein

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=20230713120344.1422468-1-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).