On Wed, Oct 24, 2018 at 5:19 AM Ketil Froyn <ketil@froyn.name> wrote:
Hi,

I'm trying to get yaffs2 working on an Ubuntu VM for a proof of
concept, and after trying the bundled kernels with the current release
(Ubuntu 18.04) I looked at the kernel versions and gave Ubuntu 12.04
with kernel 3.2.79 a try. Yaffs2 (commit 3439fa4) compiled fine with
the 3.2.79 kernel. So I installed the new kernel with yaffs2 support,
and created a nandsim device which I mounted  with yaffs2 (just an
empty filesystem). This seemed to be working fine.

However, when did something trivial like "ls -l" in the yaffs2 mount,
ls failed with the message "Killed". It turns out that a call to
lgetxattr() failed with a kernel oops. This happened every time. I've
attached a stack trace of such an oops.

I tried disabling yaffs xattr support during make menuconfig, but this
doesn't appear to really switch xattr support off, despite the config
variable being disabled in the .config file:

# CONFIG_YAFFS_XATTR is not set

I attempted to _really_ disable xattr support with this patch,
successfully this time:

--- a/yaffs_vfs_multi.c
+++ b/yaffs_vfs_multi.c
@@ -240,9 +240,11 @@ MODULE_PARM(yaffs_gc_control, "i");
 #define YAFFS_USE_DIR_ITERATE
 #endif

+#if 0
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0))
 #define YAFFS_USE_XATTR
 #endif
+#endif

 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
 #define YAFFS_NEW_PROCFS


Now things appear to be working much better. Calls to lgetxattr()
return EOPNOTSUPP, and everything works.

So I suspect there are two issues at play here:

1. DIsabling yaffs xattr support in the kernel config doesn't really disable it
2. There's a kernel oops in the xattr code

Thanks Ketil

I will add those to my todo list.

-- CHarles