Re: [linux-yocto] [PATCH v5.15 00/21] aufs: update from 5.14-20210906 to 5.15.5-20220221+

2022-03-24 Thread Paul Gortmaker
[[linux-yocto] [PATCH v5.15 00/21] aufs: update from 5.14-20210906 to 
5.15.5-20220221+] On 24/03/2022 (Thu 10:41) Paul Gortmaker wrote:

> I can push to linux-yocto-contrib once the push hook is fixed if needed.


The following changes since commit 70cf8dde55448a804da825139fa12daf5a855047:

  Merge tag 'v5.15.30' into v5.15/standard/base (2022-03-21 07:44:52 -0400)

are available in the Git repository at:

  git://git.yoctoproject.org/linux-yocto-contrib aufs-5.15.5-20220221

for you to fetch changes up to b98d189df02cc340bfbd61d4c8ef278800a8730e:

  aufs: bugfix, umount passes NULL to ->parse_monolithic() (2022-03-23 21:36:04 
-0400)


J. R. Okajima (16):
  aufs: for v5.15-rc1, no mand-lock anymore
  aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
  aufs: for v5.15-rc1, sync_inode() is gone
  aufs: pre fs_context, convert the type of alloc_sbinfo()
  aufs: pre fs_context, support the incomplete sb and sbinfo case
  aufs: pre fs_context, convert a static flag to a macro
  aufs: fs_context 1/7, skelton of the new shceme
  aufs: fs_context 2/7, parse "br" mount option
  aufs: fs_context 3/7, parse the branch-management options
  aufs: fs_context 4/7, parse xino options
  aufs: fs_context 5/7, parse all other mount options
  aufs: fs_context 6/7, now mount
  aufs: fs_context 7/7, finally remount
  aufs: tiny, headers after fs_context
  aufs standalone: cosmetic, missing copyright sentence
  aufs: bugfix, umount passes NULL to ->parse_monolithic()

Paul Gortmaker (5):
  Revert "aufs: adjust to v5.15 fs changes"
  aufs: 5.14-20210906  ---> 5.14-20211018
  aufs: 5.14-20211018 ---> 5.15.5-20211129
  aufs: 5.15.5-20211129 ---> 5.15.5-20220117
  aufs: 5.15.5-20220117 ---> 5.15.5-20220221

 Documentation/filesystems/aufs/README |2 +-
 fs/aufs/Makefile  |2 +-
 fs/aufs/cpup.c|6 +-
 fs/aufs/debug.c   |5 +-
 fs/aufs/dentry.c  |   36 +-
 fs/aufs/dentry.h  |2 +-
 fs/aufs/dirren.c  |9 +-
 fs/aufs/export.c  |   13 +-
 fs/aufs/fsctx.c   | 1242 +
 fs/aufs/i_op.c|1 -
 fs/aufs/i_op_del.c|   13 +-
 fs/aufs/i_op_ren.c|   14 +-
 fs/aufs/opts.c|  998 ++
 fs/aufs/opts.h|   46 +-
 fs/aufs/plink.c   |   62 +-
 fs/aufs/posix_acl.c   |   10 +-
 fs/aufs/sbinfo.c  |   14 +-
 fs/aufs/super.c   |  247 +--
 fs/aufs/super.h   |9 +-
 fs/aufs/vfsub.c   |   34 +-
 fs/aufs/vfsub.h   |   10 +-
 fs/aufs/whout.c   |   82 +--
 fs/aufs/whout.h   |4 +-
 fs/aufs/xino.c|   13 +-
 include/uapi/linux/aufs_type.h|2 +-
 25 files changed, 1581 insertions(+), 1295 deletions(-)
 create mode 100644 fs/aufs/fsctx.c

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11082): 
https://lists.yoctoproject.org/g/linux-yocto/message/11082
Mute This Topic: https://lists.yoctoproject.org/mt/9691/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 20/21] aufs standalone: cosmetic, missing copyright sentence

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 325d277142a1fff5ac844886d2495cfee5c1e7d0 aufs5-standalone upstream.

I just forgot merging the copyright sentences in the new source file
fs/aufs/fsctx.c.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index aa9b38c2..eb305670c358 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -1,6 +1,19 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2022 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
  */
 
 /*
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11081): 
https://lists.yoctoproject.org/g/linux-yocto/message/11081
Mute This Topic: https://lists.yoctoproject.org/mt/9719/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 19/21] aufs: 5.15.5-20220117 ---> 5.15.5-20220221

2022-03-24 Thread Paul Gortmaker
Corresponds to:

commit 6f292fea7136cec1752935170e44b78e0fa53ea7 (HEAD)
Author: J. R. Okajima 
Date:   Sun Feb 20 09:43:26 2022 +0900

5.15.5 20220221

in https://github.com/sfjro/aufs5-standalone.git

which via "git log --oneline --no-merges aufs5.15.5" encapsulates:

6f292fea7136 5.15.5 20220221
ac38cd415fb9 aufs: tiny, headers after fs_context
8aa55258925f aufs: fs_context 7/7, finally remount
3450ca9346c0 aufs: fs_context 6/7, now mount
e734244bd54a aufs: fs_context 5/7, parse all other mount options
3c9e9e3b9102 aufs: fs_context 4/7, parse xino options
5dc9a7c80362 aufs: fs_context 3/7, parse the branch-management options
4fdd4d389330 aufs: fs_context 2/7, parse "br" mount option
7f235dcdee2a aufs: fs_context 1/7, skelton of the new shceme
b8aa569c2ea5 aufs: pre fs_context, convert a static flag to a macro
4a19e0b7642f aufs: pre fs_context, support the incomplete sb and sbinfo case
3792c81561c7 aufs: pre fs_context, convert the type of alloc_sbinfo()
17dd5444ac51 5.15.5 20220117

Note that the series of 3+7+1 commits have been applied individually
prior to this version bump commit.

Signed-off-by: Paul Gortmaker 
---
 include/uapi/linux/aufs_type.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h
index 4b51ea9f14b4..8ae8cc22a72c 100644
--- a/include/uapi/linux/aufs_type.h
+++ b/include/uapi/linux/aufs_type.h
@@ -40,7 +40,7 @@
 #include 
 #endif /* __KERNEL__ */
 
-#define AUFS_VERSION   "5.15.5-20220117"
+#define AUFS_VERSION   "5.15.5-20220221"
 
 /* todo? move this to linux-2.6.19/include/magic.h */
 #define AUFS_SUPER_MAGIC   ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11079): 
https://lists.yoctoproject.org/g/linux-yocto/message/11079
Mute This Topic: https://lists.yoctoproject.org/mt/9714/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 21/21] aufs: bugfix, umount passes NULL to ->parse_monolithic()

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 25f5c5fdcb1b6c2a47f58b59c74547538b7b7c2a aufs5-standalone upstream.

The parameter "void *data" is NULL in unmounting.

Reported-by: PB on github
Signed-off-by: J. R. Okajima 
See-also: https://github.com/sfjro/aufs5-standalone/issues/9
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index eb305670c358..e5622fc17d60 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -1104,7 +1104,7 @@ static int au_fsctx_parse_monolithic(struct fs_context 
*fc, void *data)
 
str = data;
AuDbg("str %s\n", str);
-   while (1) {
+   while (str) {
u = is_colonopt(str);
if (u)
str[u] = '=';
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11080): 
https://lists.yoctoproject.org/g/linux-yocto/message/11080
Mute This Topic: https://lists.yoctoproject.org/mt/9715/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 18/21] aufs: tiny, headers after fs_context

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit ac38cd415fb9089b0c4ccb8f1d0588da9d6e14e5 aufs5-standalone upstream.

Since new opts.h includes linux/namei.h, all other source files are
not necessary to include it anymore.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/dentry.c | 1 -
 fs/aufs/export.c | 1 -
 fs/aufs/i_op.c   | 1 -
 fs/aufs/vfsub.c  | 1 -
 4 files changed, 4 deletions(-)

diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c
index 1bae481ab105..8f5976bc4419 100644
--- a/fs/aufs/dentry.c
+++ b/fs/aufs/dentry.c
@@ -21,7 +21,6 @@
  */
 
 #include 
-#include 
 #include "aufs.h"
 
 /*
diff --git a/fs/aufs/export.c b/fs/aufs/export.c
index e28bceb7386a..2e409acd84f0 100644
--- a/fs/aufs/export.c
+++ b/fs/aufs/export.c
@@ -22,7 +22,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index bfce27d451f1..dd59340637cf 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "aufs.h"
 
diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c
index f6e27fbcf584..9c551a27cc98 100644
--- a/fs/aufs/vfsub.c
+++ b/fs/aufs/vfsub.c
@@ -21,7 +21,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11078): 
https://lists.yoctoproject.org/g/linux-yocto/message/11078
Mute This Topic: https://lists.yoctoproject.org/mt/9713/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 13/21] aufs: fs_context 3/7, parse the branch-management options

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 5dc9a7c80362f1bbb4699aa2b9cb4d6439edfca3 aufs5-standalone upstream.

This "fs_context" series essentially moves some parts of opts.c to
fsctx.c, and adjusts it to fit fs_context scheme.  No enhancements,
no bugfixes.

Since some parts of opts.c are moved out, this commit makes aufs
unusable but compilable.

add, ins, append, prepend, del, and mod options are added. idel and
imod options are still not implemented.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 272 +++-
 fs/aufs/opts.c  | 216 --
 2 files changed, 270 insertions(+), 218 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index 92ead39cbbaa..6d281649fa3f 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -25,6 +25,8 @@ static void au_fsctx_dump(struct au_opts *opts)
/* reduce stack space */
union {
struct au_opt_add *add;
+   struct au_opt_del *del;
+   struct au_opt_mod *mod;
} u;
struct au_opt *opt;
 
@@ -37,9 +39,36 @@ static void au_fsctx_dump(struct au_opts *opts)
  u.add->bindex, u.add->pathname, u.add->perm,
  u.add->path.dentry);
break;
+   case Opt_del:
+   fallthrough;
+   case Opt_idel:
+   u.del = >del;
+   AuDbg("del {%s, %p}\n",
+ u.del->pathname, u.del->h_path.dentry);
+   break;
+   case Opt_mod:
+   fallthrough;
+   case Opt_imod:
+   u.mod = >mod;
+   AuDbg("mod {%s, 0x%x, %p}\n",
+ u.mod->path, u.mod->perm, u.mod->h_root);
+   break;
+   case Opt_append:
+   u.add = >add;
+   AuDbg("append {b%d, %s, 0x%x, %p}\n",
+ u.add->bindex, u.add->pathname, u.add->perm,
+ u.add->path.dentry);
+   break;
+   case Opt_prepend:
+   u.add = >add;
+   AuDbg("prepend {b%d, %s, 0x%x, %p}\n",
+ u.add->bindex, u.add->pathname, u.add->perm,
+ u.add->path.dentry);
+   break;
/* re-commit later */
 
default:
+   AuDbg("type %d\n", opt->type);
BUG();
}
opt++;
@@ -51,8 +80,19 @@ static void au_fsctx_dump(struct au_opts *opts)
 
 const struct fs_parameter_spec aufs_fsctx_paramspec[] = {
fsparam_string("br", Opt_br),
-   /* re-commit later */
 
+   /* "add=%d:%s" or "ins=%d:%s" */
+   fsparam_string("add", Opt_add),
+   fsparam_string("ins", Opt_add),
+   fsparam_path("append", Opt_append),
+   fsparam_path("prepend", Opt_prepend),
+
+   fsparam_path("del", Opt_del),
+   /* fsparam_s32("idel", Opt_idel), */
+   fsparam_path("mod", Opt_mod),
+   /* fsparam_string("imod", Opt_imod), */
+
+   /* re-commit later */
{}
 };
 
@@ -115,6 +155,169 @@ static int au_fsctx_parse_br(struct fs_context *fc, char 
*brspec)
return err;
 }
 
+static int au_fsctx_parse_add(struct fs_context *fc, char *addspec)
+{
+   int err, n;
+   char *p;
+   struct au_fsctx_opts *a = fc->fs_private;
+   struct au_opt *opt = a->opt;
+
+   err = -EINVAL;
+   p = strchr(addspec, ':');
+   if (unlikely(!p)) {
+   errorfc(fc, "bad arg in %s", addspec);
+   goto out;
+   }
+   *p++ = '\0';
+   err = kstrtoint(addspec, 0, );
+   if (unlikely(err)) {
+   errorfc(fc, "bad integer in %s", addspec);
+   goto out;
+   }
+   AuDbg("n %d\n", n);
+   err = au_fsctx_parse_do_add(fc, opt, p, /*len*/0, n);
+
+out:
+   AuTraceErr(err);
+   return err;
+}
+
+static int au_fsctx_parse_del(struct fs_context *fc, struct au_opt_del *del,
+ struct fs_parameter *param)
+{
+   int err;
+
+   err = -ENOMEM;
+   /* will be freed by au_fsctx_free() */
+   del->pathname = kmemdup_nul(param->string, param->size, GFP_NOFS);
+   if (unlikely(!del->pathname))
+   goto out;
+   AuDbg("del %s\n", del->pathname);
+   err = vfsub_kern_path(del->pathname, AuOpt_LkupDirFlags, >h_path);
+   if (unlikely(err))
+   errorfc(fc, "lookup failed %s (%d)", del->pathname, err);
+
+out:
+   AuTraceErr(err);
+   return err;
+}
+
+#if 0 /* reserved for future use */
+static int au_fsctx_parse_idel(struct fs_context *fc, struct au_opt_del *del,
+  aufs_bindex_t bindex)
+{
+   int err;
+ 

[linux-yocto] [PATCH 15/21] aufs: fs_context 5/7, parse all other mount options

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit e734244bd54a154dae92d264e8a6e7659507347d aufs5-standalone upstream.

This "fs_context" series essentially moves some parts of opts.c to
fsctx.c, and adjusts it to fit fs_context scheme.  No enhancements,
no bugfixes.

Since some parts of opts.c are moved out, this commit makes aufs
unusable but compilable.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 310 ++-
 fs/aufs/opts.c  | 545 ++--
 fs/aufs/opts.h  |  25 +--
 3 files changed, 381 insertions(+), 499 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index 3319bf02b31b..b7896c4c1c07 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -29,6 +29,7 @@ static void au_fsctx_dump(struct au_opts *opts)
struct au_opt_mod *mod;
struct au_opt_xino *xino;
struct au_opt_xino_itrunc *xino_itrunc;
+   struct au_opt_wbr_create *create;
} u;
struct au_opt *opt;
 
@@ -68,6 +69,19 @@ static void au_fsctx_dump(struct au_opts *opts)
  u.add->path.dentry);
break;
 
+   case Opt_dirwh:
+   AuDbg("dirwh %d\n", opt->dirwh);
+   break;
+   case Opt_rdcache:
+   AuDbg("rdcache %d\n", opt->rdcache);
+   break;
+   case Opt_rdblk:
+   AuDbg("rdblk %d\n", opt->rdblk);
+   break;
+   case Opt_rdhash:
+   AuDbg("rdhash %u\n", opt->rdhash);
+   break;
+
case Opt_xino:
u.xino = >xino;
AuDbg("xino {%s %pD}\n", u.xino->path, u.xino->file);
@@ -84,6 +98,15 @@ static void au_fsctx_dump(struct au_opts *opts)
/* simple true/false flag */
au_fsctx_TF(trunc_xino);
au_fsctx_TF(trunc_xib);
+   au_fsctx_TF(dirperm1);
+   au_fsctx_TF(plink);
+   au_fsctx_TF(shwh);
+   au_fsctx_TF(dio);
+   au_fsctx_TF(warn_perm);
+   au_fsctx_TF(verbose);
+   au_fsctx_TF(sum);
+   au_fsctx_TF(dirren);
+   au_fsctx_TF(acl);
 #undef au_fsctx_TF
 
case Opt_trunc_xino_path:
@@ -95,7 +118,57 @@ static void au_fsctx_dump(struct au_opts *opts)
case Opt_noxino:
AuLabel(noxino);
break;
-   /* re-commit later */
+
+   case Opt_list_plink:
+   AuLabel(list_plink);
+   break;
+   case Opt_udba:
+   AuDbg("udba %d, %s\n",
+ opt->udba, au_optstr_udba(opt->udba));
+   break;
+   case Opt_diropq_a:
+   AuLabel(diropq_a);
+   break;
+   case Opt_diropq_w:
+   AuLabel(diropq_w);
+   break;
+   case Opt_wsum:
+   AuLabel(wsum);
+   break;
+   case Opt_wbr_create:
+   u.create = >wbr_create;
+   AuDbg("create %d, %s\n", u.create->wbr_create,
+ au_optstr_wbr_create(u.create->wbr_create));
+   switch (u.create->wbr_create) {
+   case AuWbrCreate_MFSV:
+   fallthrough;
+   case AuWbrCreate_PMFSV:
+   AuDbg("%d sec\n", u.create->mfs_second);
+   break;
+   case AuWbrCreate_MFSRR:
+   fallthrough;
+   case AuWbrCreate_TDMFS:
+   AuDbg("%llu watermark\n",
+ u.create->mfsrr_watermark);
+   break;
+   case AuWbrCreate_MFSRRV:
+   fallthrough;
+   case AuWbrCreate_TDMFSV:
+   fallthrough;
+   case AuWbrCreate_PMFSRRV:
+   AuDbg("%llu watermark, %d sec\n",
+ u.create->mfsrr_watermark,
+ u.create->mfs_second);
+   break;
+   }
+   break;
+   case Opt_wbr_copyup:
+   AuDbg("copyup %d, %s\n", opt->wbr_copyup,
+ au_optstr_wbr_copyup(opt->wbr_copyup));
+   break;
+   case Opt_fhsm_sec:
+   AuDbg("fhsm_sec %u\n", opt->fhsm_second);
+   break;
 
default:
   

[linux-yocto] [PATCH 16/21] aufs: fs_context 6/7, now mount

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 3450ca9346c07e69e9f6686751ecbd656c61cc30 aufs5-standalone upstream.

This "fs_context" series essentially moves some parts of opts.c to
fsctx.c, and adjusts it to fit fs_context scheme.  No enhancements,
no bugfixes.

This commit makes aufs usable back but "remount" option is still
unusable.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c |  98 +++-
 fs/aufs/super.c | 118 ++--
 fs/aufs/super.h |   6 ++-
 3 files changed, 106 insertions(+), 116 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index b7896c4c1c07..eae790d2c4a2 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -19,6 +19,101 @@ struct au_fsctx_opts {
struct au_opts opts;
 };
 
+/* stop extra interpretation of errno in mount(8), and strange error messages 
*/
+static int cvt_err(int err)
+{
+   AuTraceErr(err);
+
+   switch (err) {
+   case -ENOENT:
+   case -ENOTDIR:
+   case -EEXIST:
+   case -EIO:
+   err = -EINVAL;
+   }
+   return err;
+}
+
+static int au_fsctx_fill_super(struct super_block *sb, struct fs_context *fc)
+{
+   int err;
+   struct au_fsctx_opts *a = fc->fs_private;
+   struct au_sbinfo *sbinfo = a->sbinfo;
+   struct dentry *root;
+   struct inode *inode;
+
+   sbinfo->si_sb = sb;
+   sb->s_fs_info = sbinfo;
+   kobject_get(>si_kobj);
+
+   __si_write_lock(sb);
+   si_pid_set(sb);
+   au_sbilist_add(sb);
+
+   /* all timestamps always follow the ones on the branch */
+   sb->s_flags |= SB_NOATIME | SB_NODIRATIME;
+   sb->s_flags |= SB_I_VERSION; /* do we really need this? */
+   sb->s_op = _sop;
+   sb->s_d_op = _dop;
+   sb->s_magic = AUFS_SUPER_MAGIC;
+   sb->s_maxbytes = 0;
+   sb->s_stack_depth = 1;
+   au_export_init(sb);
+   au_xattr_init(sb);
+
+   err = au_alloc_root(sb);
+   if (unlikely(err)) {
+   si_write_unlock(sb);
+   goto out;
+   }
+   root = sb->s_root;
+   inode = d_inode(root);
+   ii_write_lock_parent(inode);
+   aufs_write_unlock(root);
+
+   /* lock vfs_inode first, then aufs. */
+   inode_lock(inode);
+   aufs_write_lock(root);
+   err = au_opts_mount(sb, >opts);
+   AuTraceErr(err);
+   if (!err && au_ftest_si(sbinfo, NO_DREVAL)) {
+   sb->s_d_op = _dop_noreval;
+   /* infofc(fc, "%ps", sb->s_d_op); */
+   pr_info("%ps\n", sb->s_d_op);
+   au_refresh_dop(root, /*force_reval*/0);
+   sbinfo->si_iop_array = aufs_iop_nogetattr;
+   au_refresh_iop(inode, /*force_getattr*/0);
+   }
+   aufs_write_unlock(root);
+   inode_unlock(inode);
+   if (!err)
+   goto out; /* success */
+
+   dput(root);
+   sb->s_root = NULL;
+
+out:
+   if (unlikely(err))
+   kobject_put(>si_kobj);
+   AuTraceErr(err);
+   err = cvt_err(err);
+   AuTraceErr(err);
+   return err;
+}
+
+static int au_fsctx_get_tree(struct fs_context *fc)
+{
+   int err;
+
+   AuDbg("fc %p\n", fc);
+   err = get_tree_nodev(fc, au_fsctx_fill_super);
+
+   AuTraceErr(err);
+   return err;
+}
+
+/* -- */
+
 static void au_fsctx_dump(struct au_opts *opts)
 {
 #ifdef CONFIG_AUFS_DEBUG
@@ -1017,7 +1112,8 @@ static void au_fsctx_free(struct fs_context *fc)
 static const struct fs_context_operations au_fsctx_ops = {
.free   = au_fsctx_free,
.parse_param= au_fsctx_parse_param,
-   .parse_monolithic   = au_fsctx_parse_monolithic
+   .parse_monolithic   = au_fsctx_parse_monolithic,
+   .get_tree   = au_fsctx_get_tree
/* re-commit later */
 };
 
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index 713d2bb7f0ad..bdab4bc56811 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -847,7 +847,7 @@ static int aufs_remount_fs(struct super_block *sb, int 
*flags, char *data)
return err;
 }
 
-static const struct super_operations aufs_sop = {
+const struct super_operations aufs_sop = {
.alloc_inode= aufs_alloc_inode,
.destroy_inode  = aufs_destroy_inode,
.free_inode = aufs_free_inode,
@@ -862,7 +862,7 @@ static const struct super_operations aufs_sop = {
 
 /* -- */
 
-static int alloc_root(struct super_block *sb)
+int au_alloc_root(struct super_block *sb)
 {
int err;
struct inode *inode;
@@ -898,119 +898,8 @@ static int alloc_root(struct super_block *sb)
return err;
 }
 
-static int aufs_fill_super(struct super_block *sb, void *raw_data,
-  int silent __maybe_unused)
-{
-   int err;
-   struct au_opts opts = {
-   .opt = NULL

[linux-yocto] [PATCH 17/21] aufs: fs_context 7/7, finally remount

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 8aa55258925f264b9f5e99167dde63f5e66cd52d aufs5-standalone upstream.

This "fs_context" series essentially moves some parts of opts.c to
fsctx.c, and adjusts it to fit fs_context scheme.  No enhancements,
no bugfixes.

This commit finishes the series and makes aufs fully usable back.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 61 +++--
 fs/aufs/opts.c  | 12 ---
 fs/aufs/opts.h  |  2 --
 fs/aufs/super.c | 90 ++---
 fs/aufs/super.h |  1 +
 5 files changed, 62 insertions(+), 104 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index eae790d2c4a2..aa9b38c2 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -34,6 +34,59 @@ static int cvt_err(int err)
return err;
 }
 
+static int au_fsctx_reconfigure(struct fs_context *fc)
+{
+   int err, do_dx;
+   unsigned int mntflags;
+   struct dentry *root;
+   struct super_block *sb;
+   struct inode *inode;
+   struct au_fsctx_opts *a = fc->fs_private;
+
+   AuDbg("fc %p\n", fc);
+
+   root = fc->root;
+   sb = root->d_sb;
+   err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
+   if (!err) {
+   di_write_lock_child(root);
+   err = au_opts_verify(sb, fc->sb_flags, /*pending*/0);
+   aufs_write_unlock(root);
+   }
+
+   inode = d_inode(root);
+   inode_lock(inode);
+   err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
+   if (unlikely(err))
+   goto out;
+   di_write_lock_child(root);
+
+   /* au_opts_remount() may return an error */
+   err = au_opts_remount(sb, >opts);
+
+   if (au_ftest_opts(a->opts.flags, REFRESH))
+   au_remount_refresh(sb, au_ftest_opts(a->opts.flags,
+REFRESH_IDOP));
+
+   if (au_ftest_opts(a->opts.flags, REFRESH_DYAOP)) {
+   mntflags = au_mntflags(sb);
+   do_dx = !!au_opt_test(mntflags, DIO);
+   au_dy_arefresh(do_dx);
+   }
+
+   au_fhsm_wrote_all(sb, /*force*/1); /* ?? */
+   aufs_write_unlock(root);
+
+out:
+   inode_unlock(inode);
+   err = cvt_err(err);
+   AuTraceErr(err);
+
+   return err;
+}
+
+/* -- */
+
 static int au_fsctx_fill_super(struct super_block *sb, struct fs_context *fc)
 {
int err;
@@ -1113,8 +1166,12 @@ static const struct fs_context_operations au_fsctx_ops = 
{
.free   = au_fsctx_free,
.parse_param= au_fsctx_parse_param,
.parse_monolithic   = au_fsctx_parse_monolithic,
-   .get_tree   = au_fsctx_get_tree
-   /* re-commit later */
+   .get_tree   = au_fsctx_get_tree,
+   .reconfigure= au_fsctx_reconfigure
+   /*
+* nfs4 requires ->dup()? No.
+* I don't know what is this ->dup() for.
+*/
 };
 
 int aufs_fsctx_init(struct fs_context *fc)
diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c
index c57f79dd7ec3..703ff034c467 100644
--- a/fs/aufs/opts.c
+++ b/fs/aufs/opts.c
@@ -391,11 +391,6 @@ const char *au_optstr_wbr_copyup(int wbr_copyup)
 
 /* -- */
 
-void au_opts_free(struct au_opts *opts)
-{
-   /* empty */
-}
-
 int au_opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags,
   aufs_bindex_t bindex)
 {
@@ -432,13 +427,6 @@ int au_opt_add(struct au_opt *opt, char *opt_str, unsigned 
long sb_flags,
return err;
 }
 
-/* called without aufs lock */
-int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts)
-{
-   /* empty */
-   return 0;
-}
-
 static int au_opt_wbr_create(struct super_block *sb,
 struct au_opt_wbr_create *create)
 {
diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h
index 265f751351c8..3aa8ed1ccc03 100644
--- a/fs/aufs/opts.h
+++ b/fs/aufs/opts.h
@@ -245,11 +245,9 @@ const char *au_optstr_wbr_create(int wbr_create);
 int au_wbr_copyup_val(char *str);
 const char *au_optstr_wbr_copyup(int wbr_copyup);
 
-void au_opts_free(struct au_opts *opts);
 int au_opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags,
   aufs_bindex_t bindex);
 struct super_block;
-int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts);
 int au_opts_verify(struct super_block *sb, unsigned long sb_flags,
   unsigned int pending);
 int au_opts_mount(struct super_block *sb, struct au_opts *opts);
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index bdab4bc56811..24a5c99eea3b 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -701,7 +701,7 @@ static int au_refresh_i(struct super_block *sb, unsigned 
int do_idop)
return err;
 }
 
-static void au_remount_refresh(struct super_block *sb, 

[linux-yocto] [PATCH 11/21] aufs: fs_context 1/7, skelton of the new shceme

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 7f235dcdee2a7706517d893c851cf14fabca6a7c aufs5-standalone upstream.

Introduces a new file fs/aufs/fsctx.c which defines
- file_system_type->init_fs_context()
- file_system_type->parameters
- fs_context_operations->free()
but they are not completed and not activated yet.
This series "fs_context" will add the support for fs_context step by
step, and these operations will be filled and set in the succeeding
commits.

The commit itself is rather meaningless and never affect the
behaviour.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/Makefile |  2 +-
 fs/aufs/fsctx.c  | 89 
 2 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 fs/aufs/fsctx.c

diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 2c819a64935e..4af8ecde3e3f 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -17,7 +17,7 @@ ccflags-y += -include 
${srctree}/include/uapi/linux/aufs_type.h
 endif
 
 obj-$(CONFIG_AUFS_FS) += aufs.o
-aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \
+aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o fsctx.o \
wkq.o vfsub.o dcsub.o \
cpup.o whout.o wbr_policy.o \
dinfo.o dentry.o \
diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
new file mode 100644
index ..f02cc9005d95
--- /dev/null
+++ b/fs/aufs/fsctx.c
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022 Junjiro R. Okajima
+ */
+
+/*
+ * fs context, aka new mount api
+ */
+
+#include 
+#include "aufs.h"
+
+struct au_fsctx_opts {
+   struct au_opt *opt, *opt_tail;
+   struct super_block *sb;
+   struct au_sbinfo *sbinfo;
+   struct au_opts opts;
+};
+
+static void au_fsctx_free(struct fs_context *fc)
+{
+   struct au_fsctx_opts *a = fc->fs_private;
+
+   /* fs_type=%p, root=%pD */
+   AuDbg("fc %p{sb_flags 0x%x, sb_flags_mask 0x%x, purpose %u\n",
+ fc, fc->sb_flags, fc->sb_flags_mask, fc->purpose);
+
+   kobject_put(>sbinfo->si_kobj);
+   free_page((unsigned long)a->opts.opt);
+   au_kfree_rcu(a);
+}
+
+static const struct fs_context_operations au_fsctx_ops = {
+   .free   = au_fsctx_free
+   /* re-commit later */
+};
+
+int aufs_fsctx_init(struct fs_context *fc)
+{
+   int err;
+   struct au_fsctx_opts *a;
+
+   /* fs_type=%p, root=%pD */
+   AuDbg("fc %p{sb_flags 0x%x, sb_flags_mask 0x%x, purpose %u\n",
+ fc, fc->sb_flags, fc->sb_flags_mask, fc->purpose);
+
+   /* they will be freed by au_fsctx_free() */
+   err = -ENOMEM;
+   a = kzalloc(sizeof(*a), GFP_NOFS);
+   if (unlikely(!a))
+   goto out;
+   a->opts.opt = (void *)__get_free_page(GFP_NOFS);
+   if (unlikely(!a->opts.opt))
+   goto out_a;
+   a->opt = a->opts.opt;
+   a->opt->type = 0; /* re-commit later */
+   a->opts.max_opt = PAGE_SIZE / sizeof(*a->opts.opt);
+   a->opt_tail = a->opt + a->opts.max_opt - 1;
+   a->opts.sb_flags = fc->sb_flags;
+
+   a->sb = NULL;
+   if (fc->root) {
+   AuDebugOn(fc->purpose != FS_CONTEXT_FOR_RECONFIGURE);
+   a->opts.flags = AuOpts_REMOUNT;
+   a->sb = fc->root->d_sb;
+   a->sbinfo = au_sbi(a->sb);
+   kobject_get(>sbinfo->si_kobj);
+   } else {
+   a->sbinfo = au_si_alloc(a->sb);
+   AuDebugOn(!a->sbinfo);
+   err = PTR_ERR(a->sbinfo);
+   if (IS_ERR(a->sbinfo))
+   goto out_opt;
+   au_rw_write_unlock(>sbinfo->si_rwsem);
+   }
+
+   err = 0;
+   fc->fs_private = a;
+   fc->ops = _fsctx_ops;
+   goto out; /* success */
+
+out_opt:
+   free_page((unsigned long)a->opts.opt);
+out_a:
+   au_kfree_rcu(a);
+out:
+   AuTraceErr(err);
+   return err;
+}
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11072): 
https://lists.yoctoproject.org/g/linux-yocto/message/11072
Mute This Topic: https://lists.yoctoproject.org/mt/9702/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 14/21] aufs: fs_context 4/7, parse xino options

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 3c9e9e3b9102387b69d6e468f654223a5491b912 aufs5-standalone upstream.

This "fs_context" series essentially moves some parts of opts.c to
fsctx.c, and adjusts it to fit fs_context scheme.  No enhancements,
no bugfixes.

Since some parts of opts.c are moved out, this commit makes aufs
unusable but compilable.

xino/noxino, trunc_xino/notrunc_xino, itrunc_xino, and
trunc_xib/notrunc_xib options are added.  trunx_xino_v and zxino
options are still not implemented.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 200 +++-
 fs/aufs/opts.c  | 173 +++--
 fs/aufs/opts.h  |   5 +-
 3 files changed, 213 insertions(+), 165 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index 6d281649fa3f..3319bf02b31b 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -27,6 +27,8 @@ static void au_fsctx_dump(struct au_opts *opts)
struct au_opt_add *add;
struct au_opt_del *del;
struct au_opt_mod *mod;
+   struct au_opt_xino *xino;
+   struct au_opt_xino_itrunc *xino_itrunc;
} u;
struct au_opt *opt;
 
@@ -65,6 +67,34 @@ static void au_fsctx_dump(struct au_opts *opts)
  u.add->bindex, u.add->pathname, u.add->perm,
  u.add->path.dentry);
break;
+
+   case Opt_xino:
+   u.xino = >xino;
+   AuDbg("xino {%s %pD}\n", u.xino->path, u.xino->file);
+   break;
+
+#define au_fsctx_TF(name)\
+   case Opt_##name:  \
+   if (opt->tf)  \
+   AuLabel(name);\
+   else  \
+   AuLabel(no##name);\
+   break;
+
+   /* simple true/false flag */
+   au_fsctx_TF(trunc_xino);
+   au_fsctx_TF(trunc_xib);
+#undef au_fsctx_TF
+
+   case Opt_trunc_xino_path:
+   fallthrough;
+   case Opt_itrunc_xino:
+   u.xino_itrunc = >xino_itrunc;
+   AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex);
+   break;
+   case Opt_noxino:
+   AuLabel(noxino);
+   break;
/* re-commit later */
 
default:
@@ -78,6 +108,14 @@ static void au_fsctx_dump(struct au_opts *opts)
 
 /* -- */
 
+/*
+ * For conditionally compiled mount options.
+ * Instead of fsparam_flag_no(), use this macro to distinguish ignore_silent.
+ */
+#define au_ignore_flag(name, action)   \
+   fsparam_flag(name, action), \
+   fsparam_flag("no" name, Opt_ignore_silent)
+
 const struct fs_parameter_spec aufs_fsctx_paramspec[] = {
fsparam_string("br", Opt_br),
 
@@ -92,6 +130,16 @@ const struct fs_parameter_spec aufs_fsctx_paramspec[] = {
fsparam_path("mod", Opt_mod),
/* fsparam_string("imod", Opt_imod), */
 
+   fsparam_path("xino", Opt_xino),
+   fsparam_flag("noxino", Opt_noxino),
+   fsparam_flag_no("trunc_xino", Opt_trunc_xino),
+   /* "trunc_xino_v=%d:%d" */
+   /* fsparam_string("trunc_xino_v", Opt_trunc_xino_v), */
+   fsparam_path("trunc_xino", Opt_trunc_xino_path),
+   fsparam_s32("itrunc_xino", Opt_itrunc_xino),
+   /* fsparam_path("zxino", Opt_zxino), */
+   fsparam_flag_no("trunc_xib", Opt_trunc_xib),
+
/* re-commit later */
{}
 };
@@ -318,6 +366,108 @@ static int au_fsctx_parse_imod(struct fs_context *fc, 
struct au_opt_mod *mod,
 }
 #endif
 
+static int au_fsctx_parse_xino(struct fs_context *fc,
+  struct au_opt_xino *xino,
+  struct fs_parameter *param)
+{
+   int err;
+   struct au_fsctx_opts *a = fc->fs_private;
+
+   err = -ENOMEM;
+   /* will be freed by au_opts_free() */
+   xino->path = kmemdup_nul(param->string, param->size, GFP_NOFS);
+   if (unlikely(!xino->path))
+   goto out;
+   AuDbg("path %s\n", xino->path);
+
+   xino->file = au_xino_create(a->sb, xino->path, /*silent*/0,
+   /*wbrtop*/0);
+   err = PTR_ERR(xino->file);
+   if (IS_ERR(xino->file)) {
+   xino->file = NULL;
+   goto out;
+   }
+
+   err = 0;
+   if (unlikely(a->sb && xino->file->f_path.dentry->d_sb == a->sb)) {
+   err = -EINVAL;
+   errorfc(fc, "%s must be outside", xino->path);
+   }
+
+out:
+   AuTraceErr(err);
+   return 

[linux-yocto] [PATCH 07/21] aufs: 5.15.5-20211129 ---> 5.15.5-20220117

2022-03-24 Thread Paul Gortmaker
Corresponds to:

commit 17dd5444ac51cc6f10ff4af464bf3392a8a52b79 (HEAD)
Author: J. R. Okajima 
Date:   Wed Jan 12 01:38:48 2022 +0900

5.15.5 20220117

in https://github.com/sfjro/aufs5-standalone.git

which via "git log --oneline --no-merges aufs5.15.5" encapsulates:

17dd5444ac51 5.15.5 20220117
b043ceba31e2 aufs: update the donators list
fcc56866b84d 5.15.5 20211129

Signed-off-by: Paul Gortmaker 
---
 Documentation/filesystems/aufs/README | 2 +-
 include/uapi/linux/aufs_type.h| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/aufs/README 
b/Documentation/filesystems/aufs/README
index d08a56444e22..9c05340b9dda 100644
--- a/Documentation/filesystems/aufs/README
+++ b/Documentation/filesystems/aufs/README
@@ -369,7 +369,7 @@ lauri kasvandik made a donation (2013/5).
 The Parted Magic Project made a donation (2013/9 and 11).
 Pavel Barta made a donation (2013/10).
 Nikolay Pertsev made a donation (2014/5).
-James B made a donation (2014/7 and 2015/7).
+James B made a donation (2014/7, 2015/7, and 2021/12).
 Stefano Di Biase made a donation (2014/8).
 Daniel Epellei made a donation (2015/1).
 OmegaPhil made a donation (2016/1, 2018/4).
diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h
index 5219a4d117b3..4b51ea9f14b4 100644
--- a/include/uapi/linux/aufs_type.h
+++ b/include/uapi/linux/aufs_type.h
@@ -40,7 +40,7 @@
 #include 
 #endif /* __KERNEL__ */
 
-#define AUFS_VERSION   "5.15.5-20211129"
+#define AUFS_VERSION   "5.15.5-20220117"
 
 /* todo? move this to linux-2.6.19/include/magic.h */
 #define AUFS_SUPER_MAGIC   ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11070): 
https://lists.yoctoproject.org/g/linux-yocto/message/11070
Mute This Topic: https://lists.yoctoproject.org/mt/9700/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 10/21] aufs: pre fs_context, convert a static flag to a macro

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit b8aa569c2ea55f158a9b0824c8dff1bd7fbb8e61 aufs5-standalone upstream.

This series "pre fs_context" prepares for the succeeding series
"fs_context" which makes aufs supports new fsopen/fsconfig/fsmount
systemcalls.
The commit itself is less meaningful and never affect the behaviour.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/opts.c | 11 ---
 fs/aufs/opts.h |  3 +++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c
index 019a6c7aa8d2..b5dde6856069 100644
--- a/fs/aufs/opts.c
+++ b/fs/aufs/opts.c
@@ -20,7 +20,6 @@
  * mount options/flags
  */
 
-#include 
 #include  /* a distribution requires */
 #include 
 #include "aufs.h"
@@ -552,8 +551,6 @@ const char *au_optstr_wbr_copyup(int wbr_copyup)
 
 /* -- */
 
-static const int lkup_dirflags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
-
 static void dump_opts(struct au_opts *opts)
 {
 #ifdef CONFIG_AUFS_DEBUG
@@ -796,7 +793,7 @@ static int opt_add(struct au_opt *opt, char *opt_str, 
unsigned long sb_flags,
add->perm = br_perm_val(p);
}
 
-   err = vfsub_kern_path(add->pathname, lkup_dirflags, >path);
+   err = vfsub_kern_path(add->pathname, AuOpt_LkupDirFlags, >path);
if (!err) {
if (!p) {
add->perm = AuBrPerm_RO;
@@ -822,7 +819,7 @@ static int au_opts_parse_del(struct au_opt_del *del, 
substring_t args[])
del->pathname = args[0].from;
AuDbg("del path %s\n", del->pathname);
 
-   err = vfsub_kern_path(del->pathname, lkup_dirflags, >h_path);
+   err = vfsub_kern_path(del->pathname, AuOpt_LkupDirFlags, >h_path);
if (unlikely(err))
pr_err("lookup failed %s (%d)\n", del->pathname, err);
 
@@ -870,7 +867,7 @@ au_opts_parse_mod(struct au_opt_mod *mod, substring_t 
args[])
}
 
*p++ = 0;
-   err = vfsub_kern_path(mod->path, lkup_dirflags, );
+   err = vfsub_kern_path(mod->path, AuOpt_LkupDirFlags, );
if (unlikely(err)) {
pr_err("lookup failed %s (%d)\n", mod->path, err);
goto out;
@@ -948,7 +945,7 @@ au_opts_parse_xino_itrunc_path(struct super_block *sb,
struct path path;
struct dentry *root;
 
-   err = vfsub_kern_path(args[0].from, lkup_dirflags, );
+   err = vfsub_kern_path(args[0].from, AuOpt_LkupDirFlags, );
if (unlikely(err)) {
pr_err("lookup failed %s (%d)\n", args[0].from, err);
goto out;
diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h
index 960bce3ca2f2..98486c6b6579 100644
--- a/fs/aufs/opts.h
+++ b/fs/aufs/opts.h
@@ -25,6 +25,7 @@
 
 #ifdef __KERNEL__
 
+#include 
 #include 
 
 struct file;
@@ -72,6 +73,8 @@ struct file;
 | AuOpt_UDBA_REVAL \
 | AuOpt_UDBA_HNOTIFY)
 
+#define AuOpt_LkupDirFlags (LOOKUP_FOLLOW | LOOKUP_DIRECTORY)
+
 #define au_opt_test(flags, name)   (flags & AuOpt_##name)
 #define au_opt_set(flags, name) do { \
BUILD_BUG_ON(AuOpt_##name & AuOptMask_UDBA); \
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11071): 
https://lists.yoctoproject.org/g/linux-yocto/message/11071
Mute This Topic: https://lists.yoctoproject.org/mt/9701/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 12/21] aufs: fs_context 2/7, parse "br" mount option

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 4fdd4d3893306b2a70f38a83c9b2e4d5b55a0796 aufs5-standalone upstream.

Adds parsing mount options as fs_context operations, which was started
by the preceding commit.  This "fs_context" series essentially moves some
parts of opts.c to fsctx.c, and adjusts it to fit fs_context scheme.
No enhancements, no bugfixes.

Since some parts of opts.c are moved out, this commit makes aufs
unusable but compilable.

As a first step, we start it by "br" mount option.  The other options
will follow by the succeeding commits.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/fsctx.c | 223 +++-
 fs/aufs/opts.c  |  67 +++
 fs/aufs/opts.h  |  37 +++-
 3 files changed, 268 insertions(+), 59 deletions(-)

diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c
index f02cc9005d95..92ead39cbbaa 100644
--- a/fs/aufs/fsctx.c
+++ b/fs/aufs/fsctx.c
@@ -11,12 +11,227 @@
 #include "aufs.h"
 
 struct au_fsctx_opts {
+   aufs_bindex_t bindex;
+   unsigned char skipped;
struct au_opt *opt, *opt_tail;
struct super_block *sb;
struct au_sbinfo *sbinfo;
struct au_opts opts;
 };
 
+static void au_fsctx_dump(struct au_opts *opts)
+{
+#ifdef CONFIG_AUFS_DEBUG
+   /* reduce stack space */
+   union {
+   struct au_opt_add *add;
+   } u;
+   struct au_opt *opt;
+
+   opt = opts->opt;
+   while (opt->type != Opt_tail) {
+   switch (opt->type) {
+   case Opt_add:
+   u.add = >add;
+   AuDbg("add {b%d, %s, 0x%x, %p}\n",
+ u.add->bindex, u.add->pathname, u.add->perm,
+ u.add->path.dentry);
+   break;
+   /* re-commit later */
+
+   default:
+   BUG();
+   }
+   opt++;
+   }
+#endif
+}
+
+/* -- */
+
+const struct fs_parameter_spec aufs_fsctx_paramspec[] = {
+   fsparam_string("br", Opt_br),
+   /* re-commit later */
+
+   {}
+};
+
+static int au_fsctx_parse_do_add(struct fs_context *fc, struct au_opt *opt,
+char *brspec, size_t speclen,
+aufs_bindex_t bindex)
+{
+   int err;
+   char *p;
+
+   AuDbg("brspec %s\n", brspec);
+
+   err = -ENOMEM;
+   if (!speclen)
+   speclen = strlen(brspec);
+   /* will be freed by au_fsctx_free() */
+   p = kmemdup_nul(brspec, speclen, GFP_NOFS);
+   if (unlikely(!p)) {
+   errorfc(fc, "failed in %s", brspec);
+   goto out;
+   }
+   err = au_opt_add(opt, p, fc->sb_flags, bindex);
+
+out:
+   AuTraceErr(err);
+   return err;
+}
+
+static int au_fsctx_parse_br(struct fs_context *fc, char *brspec)
+{
+   int err;
+   char *p;
+   struct au_fsctx_opts *a = fc->fs_private;
+   struct au_opt *opt = a->opt;
+   aufs_bindex_t bindex = a->bindex;
+
+   AuDbg("brspec %s\n", brspec);
+
+   err = -EINVAL;
+   while ((p = strsep(, ":")) && *p) {
+   err = au_fsctx_parse_do_add(fc, opt, p, /*len*/0, bindex);
+   AuTraceErr(err);
+   if (unlikely(err))
+   break;
+   bindex++;
+   opt++;
+   if (unlikely(opt > a->opt_tail)) {
+   err = -E2BIG;
+   bindex--;
+   opt--;
+   break;
+   }
+   opt->type = Opt_tail;
+   a->skipped = 1;
+   }
+   a->bindex = bindex;
+   a->opt = opt;
+
+   AuTraceErr(err);
+   return err;
+}
+
+static int au_fsctx_parse_param(struct fs_context *fc, struct fs_parameter 
*param)
+{
+   int err, token;
+   struct fs_parse_result result;
+   struct au_fsctx_opts *a = fc->fs_private;
+   struct au_opt *opt = a->opt;
+
+   AuDbg("fc %p, param {key %s, string %s}\n",
+ fc, param->key, param->string);
+   err = fs_parse(fc, aufs_fsctx_paramspec, param, );
+   if (unlikely(err < 0))
+   goto out;
+   token = err;
+   AuDbg("token %d, res{negated %d, uint64 %llu}\n",
+ token, result.negated, result.uint_64);
+
+   err = -EINVAL;
+   a->skipped = 0;
+   switch (token) {
+   case Opt_br:
+   err = au_fsctx_parse_br(fc, param->string);
+   break;
+   /* re-commit later */
+
+   default:
+   a->skipped = 1;
+   err = -ENOPARAM;
+   break;
+   }
+   if (unlikely(err))
+   goto out;
+   if (a->skipped)
+   goto out;
+
+   switch (token) {
+   case Opt_br:
+   break;
+   default:
+   opt->type = token;
+   break;

[linux-yocto] [PATCH 09/21] aufs: pre fs_context, support the incomplete sb and sbinfo case

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 4a19e0b7642f1bda78be13b532f0c2eb687e291b aufs5-standalone upstream.

This series "pre fs_context" prepares for the succeeding series
"fs_context" which makes aufs supports new fsopen/fsconfig/fsmount
systemcalls.
The commit itself is less meaningful and never affect the behaviour.

This commit supports the incomplete/unfinished superblock and sbinfo,
in order to suppot the error during parse or mount phase in
fs_context.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/sbinfo.c |  6 +++--
 fs/aufs/super.c  | 57 +++-
 fs/aufs/xino.c   |  2 +-
 3 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c
index 2a2b804d1029..0169428a4298 100644
--- a/fs/aufs/sbinfo.c
+++ b/fs/aufs/sbinfo.c
@@ -124,8 +124,10 @@ struct au_sbinfo *au_si_alloc(struct super_block *sb)
 
/* leave other members for sysaufs and si_mnt. */
sbinfo->si_sb = sb;
-   sb->s_fs_info = sbinfo;
-   si_pid_set(sb);
+   if (sb) {
+   sb->s_fs_info = sbinfo;
+   si_pid_set(sb);
+   }
return sbinfo; /* success */
 
 out_br:
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index 666e1837ffbb..713d2bb7f0ad 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -923,10 +923,11 @@ static int aufs_fill_super(struct super_block *sb, void 
*raw_data,
opts.max_opt = PAGE_SIZE / sizeof(*opts.opt);
opts.sb_flags = sb->s_flags;
 
-   err = au_si_alloc(sb);
-   if (unlikely(err))
+   sbinfo = au_si_alloc(sb);
+   AuDebugOn(!sbinfo);
+   err = PTR_ERR(sbinfo);
+   if (unlikely(IS_ERR(sbinfo)))
goto out_opts;
-   sbinfo = au_sbi(sb);
 
/* all timestamps always follow the ones on the branch */
sb->s_flags |= SB_NOATIME | SB_NODIRATIME;
@@ -1013,26 +1014,42 @@ static struct dentry *aufs_mount(struct 
file_system_type *fs_type, int flags,
 static void aufs_kill_sb(struct super_block *sb)
 {
struct au_sbinfo *sbinfo;
+   struct dentry *root;
 
sbinfo = au_sbi(sb);
-   if (sbinfo) {
-   au_sbilist_del(sb);
-   aufs_write_lock(sb->s_root);
-   au_fhsm_fin(sb);
-   if (sbinfo->si_wbr_create_ops->fin)
-   sbinfo->si_wbr_create_ops->fin(sb);
-   if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) {
-   au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE);
-   au_remount_refresh(sb, /*do_idop*/0);
-   }
-   if (au_opt_test(sbinfo->si_mntflags, PLINK))
-   au_plink_put(sb, /*verbose*/1);
-   au_xino_clr(sb);
-   au_dr_opt_flush(sb);
-   sbinfo->si_sb = NULL;
-   aufs_write_unlock(sb->s_root);
-   au_nwt_flush(>si_nowait);
+   if (!sbinfo)
+   goto out;
+
+   au_sbilist_del(sb);
+
+   root = sb->s_root;
+   if (root)
+   aufs_write_lock(root);
+   else
+   __si_write_lock(sb);
+
+   au_fhsm_fin(sb);
+   if (sbinfo->si_wbr_create_ops->fin)
+   sbinfo->si_wbr_create_ops->fin(sb);
+   if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) {
+   au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE);
+   au_remount_refresh(sb, /*do_idop*/0);
}
+   if (au_opt_test(sbinfo->si_mntflags, PLINK))
+   au_plink_put(sb, /*verbose*/1);
+   au_xino_clr(sb);
+   if (root)
+   au_dr_opt_flush(sb);
+
+   if (root)
+   aufs_write_unlock(root);
+   else
+   __si_write_unlock(sb);
+
+   sbinfo->si_sb = NULL;
+   au_nwt_flush(>si_nowait);
+
+out:
kill_anon_super(sb);
 }
 
diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c
index e6683663885b..4e7e39c98edf 100644
--- a/fs/aufs/xino.c
+++ b/fs/aufs/xino.c
@@ -209,7 +209,7 @@ struct file *au_xino_create(struct super_block *sb, char 
*fpath, int silent,
}
 
err = -EINVAL;
-   if (unlikely(sb == d->d_sb)) {
+   if (unlikely(sb && sb == d->d_sb)) {
if (!silent)
pr_err("%s must be outside\n", fpath);
goto out;
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11068): 
https://lists.yoctoproject.org/g/linux-yocto/message/11068
Mute This Topic: https://lists.yoctoproject.org/mt/9698/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 08/21] aufs: pre fs_context, convert the type of alloc_sbinfo()

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 3792c81561c787a50cd5d5d788f118c22d8eab40 aufs5-standalone upstream.

This series "pre fs_context" prepares for the succeeding series
"fs_context" which makes aufs supports new fsopen/fsconfig/fsmount
systemcalls.
The commit itself is less meaningful and never affect the behaviour.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/sbinfo.c | 8 
 fs/aufs/super.h  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c
index 91e62d79e099..2a2b804d1029 100644
--- a/fs/aufs/sbinfo.c
+++ b/fs/aufs/sbinfo.c
@@ -56,10 +56,10 @@ void au_si_free(struct kobject *kobj)
au_kfree_rcu(sbinfo);
 }
 
-int au_si_alloc(struct super_block *sb)
+struct au_sbinfo *au_si_alloc(struct super_block *sb)
 {
-   int err, i;
struct au_sbinfo *sbinfo;
+   int err, i;
 
err = -ENOMEM;
sbinfo = kzalloc(sizeof(*sbinfo), GFP_NOFS);
@@ -126,14 +126,14 @@ int au_si_alloc(struct super_block *sb)
sbinfo->si_sb = sb;
sb->s_fs_info = sbinfo;
si_pid_set(sb);
-   return 0; /* success */
+   return sbinfo; /* success */
 
 out_br:
au_kfree_try_rcu(sbinfo->si_branch);
 out_sbinfo:
au_kfree_rcu(sbinfo);
 out:
-   return err;
+   return ERR_PTR(err);
 }
 
 int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink)
diff --git a/fs/aufs/super.h b/fs/aufs/super.h
index 4a7ac7acdb52..fd56cad2d117 100644
--- a/fs/aufs/super.h
+++ b/fs/aufs/super.h
@@ -272,7 +272,7 @@ void au_iarray_free(struct inode **a, unsigned long long 
max);
 
 /* sbinfo.c */
 void au_si_free(struct kobject *kobj);
-int au_si_alloc(struct super_block *sb);
+struct au_sbinfo *au_si_alloc(struct super_block *sb);
 int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink);
 
 unsigned int au_sigen_inc(struct super_block *sb);
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11067): 
https://lists.yoctoproject.org/g/linux-yocto/message/11067
Mute This Topic: https://lists.yoctoproject.org/mt/9696/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 05/21] aufs: for v5.15-rc1, sync_inode() is gone

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 921a67876b7225848323d8456f9fbb3732a4c996 aufs5-standalone upstream.

By the commit in mainline,
5662c967c69df 2021-08-23 fs: kill sync_inode
it was gone.
And aufs replaces it by sync_inode_metadata().

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/export.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/aufs/export.c b/fs/aufs/export.c
index 0aa20ceddd1a..e28bceb7386a 100644
--- a/fs/aufs/export.c
+++ b/fs/aufs/export.c
@@ -794,14 +794,8 @@ static int aufs_commit_metadata(struct inode *inode)
f = h_inode->i_sb->s_export_op->commit_metadata;
if (f)
err = f(h_inode);
-   else {
-   struct writeback_control wbc = {
-   .sync_mode  = WB_SYNC_ALL,
-   .nr_to_write= 0 /* metadata only */
-   };
-
-   err = sync_inode(h_inode, );
-   }
+   else
+   err = sync_inode_metadata(h_inode, /*wait*/1);
 
au_cpup_attr_timesizes(inode);
ii_write_unlock(inode);
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11065): 
https://lists.yoctoproject.org/g/linux-yocto/message/11065
Mute This Topic: https://lists.yoctoproject.org/mt/9693/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 03/21] aufs: for v5.15-rc1, no mand-lock anymore

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 494b53204c49afc0ef9c29acf17455a4ac857c97 aufs5-standalone upstream.

By the commit,
f7e33bdbd6d1b 2021-08-23 fs: remove mandatory file locking support
it was gone.

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/vfsub.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c
index e91b65a54a23..f6e27fbcf584 100644
--- a/fs/aufs/vfsub.c
+++ b/fs/aufs/vfsub.c
@@ -677,9 +677,7 @@ int vfsub_trunc(struct path *h_path, loff_t length, 
unsigned int attr,
lockdep_off();
sb_start_write(h_sb);
lockdep_on();
-   err = locks_verify_truncate(h_inode, h_file, length);
-   if (!err)
-   err = security_path_truncate(h_path);
+   err = security_path_truncate(h_path);
if (!err) {
h_userns = mnt_user_ns(h_path->mnt);
lockdep_off();
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11064): 
https://lists.yoctoproject.org/g/linux-yocto/message/11064
Mute This Topic: https://lists.yoctoproject.org/mt/9692/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH 06/21] aufs: 5.14-20211018 ---> 5.15.5-20211129

2022-03-24 Thread Paul Gortmaker
Corresponds to:

commit fcc56866b84d43fd03d9e1d91d52f40e8a9d5335 (HEAD)
Author: J. R. Okajima 
Date:   Sun Nov 28 14:02:41 2021 +0900

5.15.5 20211129

in https://github.com/sfjro/aufs5-standalone.git

Note that there would normally be a change to use the inode update
time helper in this update range, i.e.:

  commit 25e1b7e11ac8ed22672ef9d017ded03af3f23f79
  Author: J. R. Okajima 
  Date:   Thu Nov 18 23:10:14 2021 +0900

aufs: v5.16-rc1, use inode_update_time helper

as the v5.15-stable updates backported said helper, which forced us
(Yocto) to do the identical update during stable integration:

  commit ffb532fa19b901bc8d1d6dfff4524eb9937e1f03
  Author: Bruce Ashfield 
  Date:   Tue Nov 30 12:06:57 2021 -0500

aufs5: fix build against v5.15.3+

and remove the now conflicting aufs-specific EXPORT_SYMBOL_GPL(update_time)
that existed previously from the aufs base/standalone patches that
modified existing kernel filesystem infrastructure.

This one change turns out to largely be the only difference between the
aufs5.15 and aufs5.15.5 branches in the above sfjro repository.

As such, touching down on the aufs5.15 branch would just have us
revert said change and then re-add it from aufs5.15.5 - which is
why we go right from v5.14 ---> v5.15.5 directly in this commit.

Signed-off-by: Paul Gortmaker 
---
 include/uapi/linux/aufs_type.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h
index 1d62ed357532..5219a4d117b3 100644
--- a/include/uapi/linux/aufs_type.h
+++ b/include/uapi/linux/aufs_type.h
@@ -40,7 +40,7 @@
 #include 
 #endif /* __KERNEL__ */
 
-#define AUFS_VERSION   "5.14-20211018"
+#define AUFS_VERSION   "5.15.5-20211129"
 
 /* todo? move this to linux-2.6.19/include/magic.h */
 #define AUFS_SUPER_MAGIC   ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11066): 
https://lists.yoctoproject.org/g/linux-yocto/message/11066
Mute This Topic: https://lists.yoctoproject.org/mt/9694/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH v5.15 00/21] aufs: update from 5.14-20210906 to 5.15.5-20220221+

2022-03-24 Thread Paul Gortmaker
We recently had to fix an -rt aufs build failure in linux-yocto 3f9f162d9bb0
("aufs: i_op: Add handling for au_pin_hdir_set_owner with RT kernel") and then
I also recently saw a build fail on allyesconfig for a missing sync_inode().

This got me looking at what we integrated vs. what is currently upstream.
At the time Yocto started with v5.15, the then-current aufs was 5.14-20210906.
Since then, v5.15 specific branches have been created, and issue fixes
covering both the above have been added to aufs5-standalone upstream.

Given that, it seemed that an update to the latest v5.15 content was the
sensible thing to do.  This update takes us to the latest on aufs5.15.5
branch, which is 5.15.5-20220221 + two aditional fixes.

One will see below that a significant portion of the updates are related to
fs_context - see https://lwn.net/Articles/780267/  -- while I was originally
on the fence as to whether to include these, the deciding factor was seeing
that they originated on the aufs v5.14 branch before going to aufs v5.15.
So they aren't "new" in that respect.

The aufs5-standalone repository uses git and patches and merges in what could
be described as somewhat non-conventional.  Without going into details, it
doesn't lend itself to ease of updates to our previous integration as we
might be used to getting from other more conventional upstream feeds.

As such, what will be seen below is a mix of commits that were relatively
easy to extract, and version bump updates authored by myself that are a
reflection of the mix of files and patches in aufs5-standalone at the
point in time where the version bump 1st appeared.  Also one revert of our
early "make v5.14 aufs build on v5.15 baseline" was done to ease layering on
the upstream v5.15 updates (which contained the same/similar build fixes).

To be clear, I've not used aufs before, and so this is a mechanical update
performed after unwinding what we had, in conjunction with how the upstream
moves forward -- followed with allyes/mod/def config build testing.

Testing was on a v5.15.30 standard/base (linux-yocto 70cf8dde5544).  And if
users have issues, we should be in a better position to get them resolved by
aligning to the latest.

I can push to linux-yocto-contrib once the push hook is fixed if needed.

Paul.
---

J. R. Okajima (16):
  aufs: for v5.15-rc1, no mand-lock anymore
  aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()
  aufs: for v5.15-rc1, sync_inode() is gone
  aufs: pre fs_context, convert the type of alloc_sbinfo()
  aufs: pre fs_context, support the incomplete sb and sbinfo case
  aufs: pre fs_context, convert a static flag to a macro
  aufs: fs_context 1/7, skelton of the new shceme
  aufs: fs_context 2/7, parse "br" mount option
  aufs: fs_context 3/7, parse the branch-management options
  aufs: fs_context 4/7, parse xino options
  aufs: fs_context 5/7, parse all other mount options
  aufs: fs_context 6/7, now mount
  aufs: fs_context 7/7, finally remount
  aufs: tiny, headers after fs_context
  aufs standalone: cosmetic, missing copyright sentence
  aufs: bugfix, umount passes NULL to ->parse_monolithic()

Paul Gortmaker (5):
  Revert "aufs: adjust to v5.15 fs changes"
  aufs: 5.14-20210906  ---> 5.14-20211018
  aufs: 5.14-20211018 ---> 5.15.5-20211129
  aufs: 5.15.5-20211129 ---> 5.15.5-20220117
  aufs: 5.15.5-20220117 ---> 5.15.5-20220221

 Documentation/filesystems/aufs/README |2 +-
 fs/aufs/Makefile  |2 +-
 fs/aufs/cpup.c|6 +-
 fs/aufs/debug.c   |5 +-
 fs/aufs/dentry.c  |   36 +-
 fs/aufs/dentry.h  |2 +-
 fs/aufs/dirren.c  |9 +-
 fs/aufs/export.c  |   13 +-
 fs/aufs/fsctx.c   | 1242 +
 fs/aufs/i_op.c|1 -
 fs/aufs/i_op_del.c|   13 +-
 fs/aufs/i_op_ren.c|   14 +-
 fs/aufs/opts.c|  998 ++--
 fs/aufs/opts.h|   46 +-
 fs/aufs/plink.c   |   62 +-
 fs/aufs/posix_acl.c   |   10 +-
 fs/aufs/sbinfo.c  |   14 +-
 fs/aufs/super.c   |  247 +
 fs/aufs/super.h   |9 +-
 fs/aufs/vfsub.c   |   34 +-
 fs/aufs/vfsub.h   |   10 +-
 fs/aufs/whout.c   |   82 +-
 fs/aufs/whout.h   |4 +-
 fs/aufs/xino.c|   13 +-
 include/uapi/linux/aufs_type.h|2 +-
 25 files changed, 1581 insertions(+), 1295 deletions(-)
 create mode 100644 fs/aufs/fsctx.c

-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11063): 
https://lists.yoctoproject.org/g/linux-yocto/message/11063
Mute This Topic: https://lists.yoctoproject.org/mt/9691/21656
Group Owner: 

[linux-yocto] [PATCH 02/21] aufs: 5.14-20210906 ---> 5.14-20211018

2022-03-24 Thread Paul Gortmaker
To incorporate the following encapsulated changes:

05607e3cb465 5.14 20211018
9e5e47e46da7 aufs: tiny, fix an editing failure
ee28de7d4b6c aufs: support FUSE branch a little more
71dfddc73039 aufs: bugfix, stop omitting path->mnt
03a3ee3199ae 5.14 20210906

from https://github.com/sfjro/aufs5-standalone.git

Signed-off-by: Paul Gortmaker 
---
 fs/aufs/cpup.c |  6 ++-
 fs/aufs/debug.c|  5 ++-
 fs/aufs/dentry.c   | 35 +--
 fs/aufs/dentry.h   |  2 +-
 fs/aufs/dirren.c   |  9 ++--
 fs/aufs/export.c   |  2 +-
 fs/aufs/i_op_del.c | 13 --
 fs/aufs/i_op_ren.c | 14 --
 fs/aufs/plink.c| 62 -
 fs/aufs/vfsub.c| 33 --
 fs/aufs/vfsub.h| 10 ++---
 fs/aufs/whout.c| 82 +-
 fs/aufs/whout.h|  4 +-
 fs/aufs/xino.c | 11 ++---
 include/uapi/linux/aufs_type.h |  2 +-
 15 files changed, 162 insertions(+), 128 deletions(-)

diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c
index dbaa01a55904..5b8b6b25200e 100644
--- a/fs/aufs/cpup.c
+++ b/fs/aufs/cpup.c
@@ -745,11 +745,13 @@ static int au_do_ren_after_cpup(struct au_cp_generic 
*cpg, struct path *h_path)
 {
int err;
struct dentry *dentry, *h_dentry, *h_parent, *parent;
+   struct path h_ppath;
struct inode *h_dir;
aufs_bindex_t bdst;
 
dentry = cpg->dentry;
bdst = cpg->bdst;
+   h_ppath.mnt = au_sbr_mnt(dentry->d_sb, bdst);
h_dentry = au_h_dptr(dentry, bdst);
if (!au_ftest_cpup(cpg->flags, OVERWRITE)) {
dget(h_dentry);
@@ -761,9 +763,9 @@ static int au_do_ren_after_cpup(struct au_cp_generic *cpg, 
struct path *h_path)
} else {
err = 0;
parent = dget_parent(dentry);
-   h_parent = au_h_dptr(parent, bdst);
+   h_ppath.dentry = au_h_dptr(parent, bdst);
dput(parent);
-   h_path->dentry = vfsub_lkup_one(>d_name, h_parent);
+   h_path->dentry = vfsub_lkup_one(>d_name, _ppath);
if (IS_ERR(h_path->dentry))
err = PTR_ERR(h_path->dentry);
}
diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c
index f7fa23c1a9bc..3394083eadd7 100644
--- a/fs/aufs/debug.c
+++ b/fs/aufs/debug.c
@@ -383,7 +383,10 @@ void __au_dbg_verify_dinode(struct dentry *dentry, const 
char *func, int line)
AuDbgDentry(dentry);
AuDbgInode(inode);
au_debug_off();
-   BUG();
+   if (au_test_fuse(h_inode->i_sb))
+   WARN_ON_ONCE(1);
+   else
+   BUG();
}
}
 }
diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c
index 4b63daab7220..1bae481ab105 100644
--- a/fs/aufs/dentry.c
+++ b/fs/aufs/dentry.c
@@ -36,6 +36,7 @@ au_do_lookup(struct dentry *h_parent, struct dentry *dentry,
struct inode *h_inode;
struct au_branch *br;
struct user_namespace *h_userns;
+   struct path h_path;
int wh_found, opq;
unsigned char wh_able;
const unsigned char allow_neg = !!au_ftest_lkup(args->flags, ALLOW_NEG);
@@ -44,10 +45,12 @@ au_do_lookup(struct dentry *h_parent, struct dentry *dentry,
 
wh_found = 0;
br = au_sbr(dentry->d_sb, bindex);
+   h_path.dentry = h_parent;
+   h_path.mnt = au_br_mnt(br);
h_userns = au_br_userns(br);
wh_able = !!au_br_whable(br->br_perm);
if (wh_able)
-   wh_found = au_wh_test(h_userns, h_parent, >whname,
+   wh_found = au_wh_test(h_userns, _path, >whname,
  ignore_perm);
h_dentry = ERR_PTR(wh_found);
if (!wh_found)
@@ -63,9 +66,9 @@ au_do_lookup(struct dentry *h_parent, struct dentry *dentry,
 
 real_lookup:
if (!ignore_perm)
-   h_dentry = vfsub_lkup_one(args->name, h_parent);
+   h_dentry = vfsub_lkup_one(args->name, _path);
else
-   h_dentry = au_sio_lkup_one(h_userns, args->name, h_parent);
+   h_dentry = au_sio_lkup_one(h_userns, args->name, _path);
if (IS_ERR(h_dentry)) {
if (PTR_ERR(h_dentry) == -ENAMETOOLONG
&& !allow_neg)
@@ -99,8 +102,9 @@ au_do_lookup(struct dentry *h_parent, struct dentry *dentry,
|| (d_really_is_positive(dentry) && !d_is_dir(dentry)))
goto out; /* success */
 
+   h_path.dentry = h_dentry;
inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
-   opq = au_diropq_test(h_userns, h_dentry);
+   opq = au_diropq_test(h_userns, _path);
inode_unlock_shared(h_inode);
if (opq > 0)
au_set_dbdiropq(dentry, bindex);
@@ -246,18 +250,18 @@ 

[linux-yocto] [PATCH 04/21] aufs: for v5.15-rc1, new param 'rcu' for ->get_acl()

2022-03-24 Thread Paul Gortmaker
From: "J. R. Okajima" 

commit 77d7570639146519b209bc59546bd16df0442372 aufs5-standalone upstream.

Simply follows the change in mainline,
0cad6246621b5 2021-08-18 vfs: add rcu argument to ->get_acl() callback

Signed-off-by: J. R. Okajima 
Signed-off-by: Paul Gortmaker 
---
 fs/aufs/inode.h |  2 +-
 fs/aufs/posix_acl.c | 13 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h
index e092a1a03145..9d923fd3d77c 100644
--- a/fs/aufs/inode.h
+++ b/fs/aufs/inode.h
@@ -324,7 +324,7 @@ AuStubVoid(au_xattr_init, struct super_block *sb);
 #endif
 
 #ifdef CONFIG_FS_POSIX_ACL
-struct posix_acl *aufs_get_acl(struct inode *inode, int type);
+struct posix_acl *aufs_get_acl(struct inode *inode, int type, bool rcu);
 int aufs_set_acl(struct user_namespace *userns, struct inode *inode,
 struct posix_acl *acl, int type);
 #endif
diff --git a/fs/aufs/posix_acl.c b/fs/aufs/posix_acl.c
index 2fa8e6dee637..69adf2bb5212 100644
--- a/fs/aufs/posix_acl.c
+++ b/fs/aufs/posix_acl.c
@@ -23,7 +23,7 @@
 #include 
 #include "aufs.h"
 
-struct posix_acl *aufs_get_acl(struct inode *inode, int type)
+struct posix_acl *aufs_get_acl(struct inode *inode, int type, bool rcu)
 {
struct posix_acl *acl;
int err;
@@ -31,12 +31,16 @@ struct posix_acl *aufs_get_acl(struct inode *inode, int 
type)
struct inode *h_inode;
struct super_block *sb;
 
+   acl = ERR_PTR(-ECHILD);
+   if (rcu)
+   goto out;
+
acl = NULL;
sb = inode->i_sb;
si_read_lock(sb, AuLock_FLUSH);
ii_read_lock_child(inode);
if (!(sb->s_flags & SB_POSIXACL))
-   goto out;
+   goto unlock;
 
bindex = au_ibtop(inode);
h_inode = au_h_iptr(inode, bindex);
@@ -45,7 +49,7 @@ struct posix_acl *aufs_get_acl(struct inode *inode, int type)
 != (inode->i_mode & S_IFMT {
err = au_busy_or_stale();
acl = ERR_PTR(err);
-   goto out;
+   goto unlock;
}
 
/* always topmost only */
@@ -55,10 +59,11 @@ struct posix_acl *aufs_get_acl(struct inode *inode, int 
type)
else
set_cached_acl(inode, type, acl);
 
-out:
+unlock:
ii_read_unlock(inode);
si_read_unlock(sb);
 
+out:
AuTraceErrPtr(acl);
return acl;
 }
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11062): 
https://lists.yoctoproject.org/g/linux-yocto/message/11062
Mute This Topic: https://lists.yoctoproject.org/mt/9690/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-