Modify

Opened 3 years ago

Closed 2 years ago

#19046 closed defect (fixed)

YAFFS2 filesystem does't compile after switching to 3.18 kernel

Reported by: alexisgreen Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: kernel Version: Trunk
Keywords: yaffs2 mikrotik rb433 Cc:

Description

At r44497 read/write functions need to be updated to use iter versions to prevent build failure.

  CC      fs/yaffs2/yaffs_vfs.o
fs/yaffs2/yaffs_vfs.c:799:14: error: 'generic_file_aio_read' undeclared here (not in a function)
  .aio_read = generic_file_aio_read,
              ^
fs/yaffs2/yaffs_vfs.c:800:15: error: 'generic_file_aio_write' undeclared here (not in a function)
  .aio_write = generic_file_aio_write,
               ^
fs/yaffs2/yaffs_vfs.c:805:18: error: 'generic_file_splice_write' undeclared here (not in a function)
  .splice_write = generic_file_splice_write,
                  ^
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readlink':
fs/yaffs2/yaffs_vfs.c:1053:2: error: implicit declaration of function 'vfs_readlink' [-Werror=implicit-function-declaration]
  ret = vfs_readlink(dentry, buffer, buflen, alias);
  ^
cc1: some warnings being treated as errors
make[7]: *** [fs/yaffs2/yaffs_vfs.o] Error 1
make[6]: *** [fs/yaffs2] Error 2

Patch to make it compile (I've tested yaffs and it appears to behave normally with 3.18 after this).

Index: target/linux/generic/files/fs/yaffs2/yaffs_vfs.c
===================================================================
--- target/linux/generic/files/fs/yaffs2/yaffs_vfs.c    (revision 44497)
+++ target/linux/generic/files/fs/yaffs2/yaffs_vfs.c    (working copy)
@@ -764,8 +764,22 @@
        return 0;
 }

+#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 16, 0))
+static const struct file_operations yaffs_file_operations = {
+       .read = new_sync_read,
+       .write = new_sync_write,
+       .read_iter = generic_file_read_iter,
+       .write_iter = generic_file_write_iter,
+       .mmap = generic_file_mmap,
+       .flush = yaffs_file_flush,
+       .fsync = yaffs_sync_object,
+       .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
+       .llseek = generic_file_llseek,
+};

-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
+
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
 static const struct file_operations yaffs_file_operations = {
        .read = do_sync_read,
        .write = do_sync_write,
@@ -1023,7 +1037,11 @@
        if (!alias)
                return -ENOMEM;

+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 99)
        ret = vfs_readlink(dentry, buffer, buflen, alias);
+#else
+       ret = readlink_copy(buffer, buflen, alias);
+#endif
        kfree(alias);
        return ret;
 }

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by anonymous

  • yaffs code in OpenWrt is old (afaik from from 2013) and might need an update anyway

current yaffs2 code is quite different:
http://www.aleph1.co.uk/gitweb?p=yaffs2.git;a=tree

comment:2 Changed 3 years ago by Damian Kaczkowski

+1

comment:3 Changed 3 years ago by rmilecki

Fixed in r44643

[Irony] Thanks for sending a patch

comment:4 Changed 3 years ago by rmilecki

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 2 years ago by meconiotech@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Yesterday and today git error:

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':
fs/yaffs2/yaffs_vfs.c:286:29: error: 'struct file' has no member named 'f_dentry'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:286:8: note: in expansion of macro 'yaffs_dentry_to_obj'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':
fs/yaffs2/yaffs_vfs.c:484:29: error: 'struct file' has no member named 'f_dentry'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:484:8: note: in expansion of macro 'yaffs_dentry_to_obj'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c: In function 'yaffs_release_space':
fs/yaffs2/yaffs_vfs.c:502:29: error: 'struct file' has no member named 'f_dentry'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:502:8: note: in expansion of macro 'yaffs_dentry_to_obj'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':
fs/yaffs2/yaffs_vfs.c:594:29: error: 'struct file' has no member named 'f_dentry'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:594:8: note: in expansion of macro 'yaffs_dentry_to_obj'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:606:11: error: 'struct file' has no member named 'f_dentry'

inode = f->f_dentry->d_inode;


fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':
fs/yaffs2/yaffs_vfs.c:730:50: error: 'struct file' has no member named 'f_dentry'

struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:730:26: note: in expansion of macro 'yaffs_dentry_to_obj'

struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);


fs/yaffs2/yaffs_vfs.c: At top level:
fs/yaffs2/yaffs_vfs.c:779:10: error: 'new_sync_read' undeclared here (not in a function)

.read = new_sync_read,


fs/yaffs2/yaffs_vfs.c:781:11: error: 'new_sync_write' undeclared here (not in a function)

.write = new_sync_write,


fs/yaffs2/yaffs_vfs.c: In function 'yaffs_iterate':
fs/yaffs2/yaffs_vfs.c:1733:29: error: 'struct file' has no member named 'f_dentry'

obj = yaffs_dentry_to_obj(f->f_dentry);


fs/yaffs2/yaffs_vfs.c:218:39: note: in definition of macro 'yaffs_inode_to_obj_lv'

#define yaffs_inode_to_obj_lv(iptr) ((iptr)->i_private)


fs/yaffs2/yaffs_vfs.c:225:35: note: in expansion of macro 'yaffs_inode_to_obj'

#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)


fs/yaffs2/yaffs_vfs.c:1733:8: note: in expansion of macro 'yaffs_dentry_to_obj'

obj = yaffs_dentry_to_obj(f->f_dentry);


make[7]: * [fs/yaffs2/yaffs_vfs.o] Error 1
make[6]: * [fs/yaffs2] Error 2
make[5]:
* [fs] Error 2
make[5]: Leaving directory `/home/daniele/src/openwrtNUOVO/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_mikrotik/linux-4.1.4'
make[4]: * /home/daniele/src/openwrtNUOVO/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_mikrotik/linux-4.1.4/.image Error 2
make[4]: Leaving directory `/home/daniele/src/openwrtNUOVO/openwrt/target/linux/ar71xx'
make[3]:
* [install] Error 2
make[3]: Leaving directory `/home/daniele/src/openwrtNUOVO/openwrt/target/linux'
make[2]: * [target/linux/install] Error 2
make[2]: Leaving directory `/home/daniele/src/openwrtNUOVO/openwrt'
make[1]:
* /home/daniele/src/openwrtNUOVO/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.target_install Error 2
make[1]: Leaving directory `/home/daniele/src/openwrtNUOVO/openwrt'
make: * [world] Errore 2

comment:6 Changed 2 years ago by Stappers

Also reported in /ticket/20323.html

comment:7 Changed 2 years ago by hauke

  • Resolution set to fixed
  • Status changed from reopened to closed

This is a different error, this ticket is about problems with kernel 3.18 and not 4.1 use #20323 for kernel 4.1 instead.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.