All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/9] ovl: add feature set support
@ 2018-07-31  9:37 zhangyi (F)
  2018-07-31  9:37 ` [RFC PATCH v2 1/9] ovl: store ovl upper root path in ovl_fs zhangyi (F)
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: zhangyi (F) @ 2018-07-31  9:37 UTC (permalink / raw)
  To: linux-unionfs; +Cc: miklos, amir73il, yi.zhang, miaoxie, yangerkun

Hi all,

These patch set is the second version to add feature set support for
overlayfs, have already been handle most suggestions from Amir in the
last iteration. It do the following things.

- Introduce compatible, read-only compatible and incompatible these
  three kinds of feature set which indicates the features in one layer
  (not the whole overlay image), save as __be64 bit mask on each layer's
  root directory via a "trusted.overlay.featre" xattr.
- Kernel will refuse to mount if unknown incompatible feature are found
  in any one layer, and refuse to mount read-write if unknown
  ro-compatible feature are found in the upper layer.
- Set feature bitset when redirect dir xattr, index and nfs_export
  feature were set or enabled.
- Refer the layer which have feature set xattr as on-disk format v2,
  and the layer that don't have as on-disk format v1.
- Introduce two Kconfig options (OVERLAY_FS_V2 and OVERLAY_FS_UPPER_V2)
  and the counterpart module and mount options. when OVERLAY_FS_V2 (or
  the counterpart module and mount option) is set, on-disk format v2
  becomes necessary on all layers, when OVERLAY_FS_UPPER_V2 is set,
  on-disk format v2 is only necessary on the upper layer.
- Check redirect dir feature when redirect xattr is found on the
  underlying directory, fsck.overlay is required if redirect dir feature
  missing.

This patch set base on Linux-4.18-rc6 and is just request for comments,
any comment is helpful, does not yet take care of the upcoming metadata
copy-up feature and update the document, I can handle these in the next
iteration.


The counterpart fsck.overlay and mkfs.overlay program available here[*],
You may want to review it together. From 8b540194 "fsck.overlay: factor
out common header part from fsck" to the latest one d22ebd9a2
"mkfs.overlay: update README and turn on mkfs program", total 29 patches.
I can post the tools patch set if you want.

The fsck.overlay do the following:
- Add "overlayfs_v2=<off/upper/on>" fsck option as same as mount option.
- If "overlayfs_v2=off", fsck will ask user to create a new feature set
  xattr for on-disk format v1 layers, and will add the missing feature
  bit, but these are not required (except fix the corrupt feature set
  xattr).
- If "overlayfs_v2=on", consistent feature set xattr are required for
  all layers, fsck will convert layer format v1 to v2 and ensure the
  consistency of the feature set on all layers.
- If "overlayfs_v2=upper", release the requirement of feature set xattr
  on lower layers, but fsck will still warn if unrepaired corrupt
  feature xattr left over on the read-only lower layer.
- Display features to human readable string.

The mkfs.overlay do the following:
- Create new feature set xattr for each underlying layer.
- Do some basic check of the underlying layers, will refuse to make a
  new overlay iamge if an old overlayfs already existed or any one layer
  is mounted.
- Accept redirect dir, index and nfs_export feature options, and set
  the corresponding feature bitset.
- Use for new underlying layers only, doesn't give "force" options.

Thanks,
Yi.

------------------

[*] https://github.com/hisilicon/overlayfs-progs/commits/feature-set


Changes since v1:
- Feature set xattr contains features in one layer instead of the whole
  overlay image.
- Use bitset to store features instead of readable string.
- Compress all three kind of feature sets into one feature xattr instead
  of three xattrs.
- Introduce on-disk format v2 which layer's feature set xatte becomes
  necessary and add two Kconfig options, two module options and two
  mount options to enable the requirement of on-disk format v2.
- Do not auto fix redirect dir feature when redirect xattr was detected
  on directory, just give a warning message to teach user to run fsck.
- Set redirect dir feature when overlayfs set redirect xattr on
  directory.


zhangyi (F) (9):
  ovl: store ovl upper root path in ovl_fs
  ovl: read feature set from each layer's root dir
  ovl: check file system features can be mounted properly
  ovl: add helper funcs to set upper layer feature set
  ovl: add redirect dir feature when set redirect xattr to dir
  ovl: add index feature if index dir exists
  ovl: add nfs_export feature when nfs_export is enabled
  ovl: force mount underlying layers which have feature sets
  ovl: check redirect_dir feature when detect redirect xattr on dir

 fs/overlayfs/Kconfig     |  40 +++++++
 fs/overlayfs/Makefile    |   2 +-
 fs/overlayfs/dir.c       |  11 ++
 fs/overlayfs/export.c    |  12 +-
 fs/overlayfs/feature.c   | 298 +++++++++++++++++++++++++++++++++++++++++++++++
 fs/overlayfs/inode.c     |   4 +-
 fs/overlayfs/namei.c     |  35 +++++-
 fs/overlayfs/overlayfs.h |  99 ++++++++++++++++
 fs/overlayfs/ovl_entry.h |  23 +++-
 fs/overlayfs/readdir.c   |   2 +-
 fs/overlayfs/super.c     | 118 ++++++++++++++++---
 fs/overlayfs/util.c      |  10 +-
 12 files changed, 617 insertions(+), 37 deletions(-)
 create mode 100644 fs/overlayfs/feature.c

-- 
2.13.6


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

end of thread, other threads:[~2018-08-06  3:21 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  9:37 [RFC PATCH v2 0/9] ovl: add feature set support zhangyi (F)
2018-07-31  9:37 ` [RFC PATCH v2 1/9] ovl: store ovl upper root path in ovl_fs zhangyi (F)
2018-08-01  6:48   ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 2/9] ovl: read feature set from each layer's root dir zhangyi (F)
2018-08-01  7:44   ` Amir Goldstein
2018-08-03 12:11     ` zhangyi (F)
2018-07-31  9:37 ` [RFC PATCH v2 3/9] ovl: check file system features can be mounted properly zhangyi (F)
2018-08-01  8:06   ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 4/9] ovl: add helper funcs to set upper layer feature set zhangyi (F)
2018-08-01  8:51   ` Amir Goldstein
2018-08-01 11:04     ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 5/9] ovl: add redirect dir feature when set redirect xattr to dir zhangyi (F)
2018-08-01 11:03   ` Amir Goldstein
2018-08-03 11:52     ` zhangyi (F)
2018-08-03 20:38       ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 6/9] ovl: add index feature if index dir exists zhangyi (F)
2018-08-01 11:15   ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 7/9] ovl: add nfs_export feature when nfs_export is enabled zhangyi (F)
2018-08-01 11:20   ` Amir Goldstein
2018-07-31  9:37 ` [RFC PATCH v2 8/9] ovl: force mount underlying layers which have feature sets zhangyi (F)
     [not found]   ` <CAOQ4uxgZcwxENyf5STfNgL6juLoHvOBnWkORpifp0pv04oi8Ww@mail.gmail.com>
2018-08-03 11:25     ` zhangyi (F)
     [not found]       ` <CAOQ4uxjxY1Urjy2fUEkV24ZfxbDjAu1vkJcERNc_7uZVmJ+2YA@mail.gmail.com>
2018-08-06  1:15         ` zhangyi (F)
2018-07-31  9:37 ` [RFC PATCH v2 9/9] ovl: check redirect_dir feature when detect redirect xattr on dir zhangyi (F)
2018-08-01 11:30   ` Amir Goldstein
2018-08-01 11:35     ` Amir Goldstein
2018-08-02 12:30       ` Vivek Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.