Re: linux-next: Tree for April 1 [BROKEN ubifs when CONFIG_DEBUG_SECTION_MISMATCH=y]s

From: Sedat Dilek
Date: Sat Apr 02 2011 - 06:14:59 EST


On Sat, Apr 2, 2011 at 2:20 AM, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> cc'ing Jens ...
>
> On Fri, 1 Apr 2011 20:22:41 +0200 Sedat Dilek <sedat.dilek@xxxxxxxxxxxxxx> wrote:
>>
>> On Fri, Apr 1, 2011 at 7:02 PM, Artem Bityutskiy <dedekind1@xxxxxxxxx> wrote:
>> > On Fri, 2011-04-01 at 18:10 +0200, Sedat Dilek wrote:
>> >> On Fri, Apr 1, 2011 at 6:06 PM, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
>> >> > Cc'ing Artem,
>> >> >
>> >> > On Fri, 1 Apr 2011 17:55:52 +0200 Sedat Dilek <sedat.dilek@xxxxxxxxxxxxxx> wrote:
>> >> >>
>> >> >> With CONFIG_DEBUG_SECTION_MISMATCH=y set, I see in my build.log:
>> >> >> ...
>> >> >> MODPOST 2742 modules
>> >> >> ...
>> >> >> ERROR: "empty_aops" [fs/ubifs/ubifs.ko] undefined!
>> >> >> make[5]: *** [__modpost] Error 1
>> >> >> make[4]: *** [modules] Error 2
>> >> >> make[3]: *** [sub-make] Error 2
>> >> >> make[2]: *** [all] Error 2
>> >> >> make[2]: Leaving directory
>> >> >> `/home/sd/src/linux-2.6/linux-2.6.39-rc1/debian/build/build_i386_none_686-iniza'
>> >> >>
>> >> >> - Sedat -
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Cheers,
>> >> > Stephen Rothwell          Âsfr@xxxxxxxxxxxxxxxx
>> >> > http://www.canb.auug.org.au/~sfr/
>> >> >
>> >>
>> >> Speculative patch (untested).
>> >>
>> >> - Sedat -
>> >>
>> >> $ diff -uprN fs/ubifs/xattr.c.orig fs/ubifs/xattr.c
>> >> --- fs/ubifs/xattr.c.orig    2011-04-01 15:56:08.471082117 +0200
>> >> +++ fs/ubifs/xattr.c  Â2011-04-01 18:08:27.355276827 +0200
>> >> @@ -81,6 +81,7 @@ enum {
>> >>
>> >> Âstatic const struct inode_operations none_inode_operations;
>> >> Âstatic const struct file_operations none_file_operations;
>> >> +static const struct address_space_operations empty_aops;
>> >>
>> >> Â/**
>> >> Â * create_xattr - create an extended attribute.
>> >
>> > ubifs doess not have 'empty_aops' symbol and does not use such symbol. I
>> > do not understand how you got that build issue, but this must be
>> > something to do with your local setup.
>> >
>> > Also:
>> >
>> > [dedekind@eru linux-next (master)]$ grep -r 'empty_aops' *
>> > fs/nilfs2/page.c: Â Â Â static const struct address_space_operations empty_aops;
>> > fs/nilfs2/page.c: Â Â Â mapping->a_ops = &empty_aops;
>> > fs/inode.c: Â Â static const struct address_space_operations empty_aops;
>> > fs/inode.c: Â Â mapping->a_ops = &empty_aops;
>> >
>> > in the current linux-next.
>> >
>> > --
>> > Best Regards,
>> > Artem Bityutskiy (ÐÑÑÑÐ ÐÐÑÑÑÐÐÐ)
>> >
>> >
>>
>> You are right, I pulled linux-2.6-block.git#for-linus into linux-next.
>> Looks like linux-2.6-block-for-linus/0007-fs-export-empty_aops.patch
>> is causing this [1].
>>
>> - Sedat -
>>
>> [1] http://git.kernel.org/?p=linux/kernel/git/axboe/linux-2.6-block.git;a=commit;h=2c9214b7b72cf440024d8b91523eea25bbc76040
>>
>
>
> --
> Cheers,
> Stephen Rothwell          Âsfr@xxxxxxxxxxxxxxxx
> http://www.canb.auug.org.au/~sfr/
>

Just FYI:
I contacted Jens last night and he refreshed his for-linus GIT branch.
Adding missing include <linux/fs.h> did not fix the issue.
I am trying with the attached one.

- Sedat -
From 8e4229b3f2fba246d87b5963fcc4ab3a507b699a Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@xxxxxxxxx>
Date: Sat, 2 Apr 2011 10:25:13 +0200
Subject: [PATCH] nilfs2,ubifs: Use empty_aops without any functions defined

With the ->sync_page() hook gone, we have a few users that
add their own static address_space_operations without any
functions defined.

Furthermore for UBIFS:
1. Consider inode_operations and file_operations have also
no functions defined
2. Move {address_space,inode,file}_operations to create_xattr()
3. Transform to empty_{aops,fops,iops}

Signed-off-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
---
fs/nilfs2/page.c | 2 +-
fs/ubifs/xattr.c | 13 ++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c
index 9d2dc6b..e7df3f9 100644
--- a/fs/nilfs2/page.c
+++ b/fs/nilfs2/page.c
@@ -495,7 +495,7 @@ unsigned nilfs_page_count_clean_buffers(struct page *page,
void nilfs_mapping_init(struct address_space *mapping,
struct backing_dev_info *bdi)
{
- static const struct address_space_operations empty_aops;
+ static const struct address_space_operations empty_aops = {};

mapping->host = NULL;
mapping->flags = 0;
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index c74400f..d237c4f 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -79,10 +79,6 @@ enum {
SECURITY_XATTR,
};

-static const struct inode_operations none_inode_operations;
-static const struct address_space_operations none_address_operations;
-static const struct file_operations none_file_operations;
-
/**
* create_xattr - create an extended attribute.
* @c: UBIFS file-system description object
@@ -100,6 +96,9 @@ static const struct file_operations none_file_operations;
static int create_xattr(struct ubifs_info *c, struct inode *host,
const struct qstr *nm, const void *value, int size)
{
+ static const struct address_space_operations empty_aops = {};
+ static const struct inode_operations empty_iops = {};
+ static const struct file_operations empty_fops = {};
int err;
struct inode *inode;
struct ubifs_inode *ui, *host_ui = ubifs_inode(host);
@@ -130,9 +129,9 @@ static int create_xattr(struct ubifs_info *c, struct inode *host,
}

/* Re-define all operations to be "nothing" */
- inode->i_mapping->a_ops = &none_address_operations;
- inode->i_op = &none_inode_operations;
- inode->i_fop = &none_file_operations;
+ inode->i_mapping->a_ops = &empty_aops;
+ inode->i_op = &empty_iops;
+ inode->i_fop = &empty_fops;

inode->i_flags |= S_SYNC | S_NOATIME | S_NOCMTIME | S_NOQUOTA;
ui = ubifs_inode(inode);
--
1.7.4.2