Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Ahmet Inan
There is still a problem when btrfs is built-in:

err = btrfs_hash_init();

Will not succeed if run on an slow cpu (intel u7300) or in qemu if
btrfs is built-in:

# qemu-kvm -enable-kvm -usbdevice tablet -m 2048 -smp 2 -sdl -kernel
/usr/src/linux/arch/x86/boot/bzImage

But it works, when btrfs is a module.

I really do not want to go back using modules in my initramfs ..

There must be a way to move init_btrfs_fs to the end of Linux built-in
initializations ..

Ahmet
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Ahmet Inan
okay, putting late_initcall instead of module_init fixes it for me,
but this is something you guys should decide how to handle:

//module_init(init_btrfs_fs)
late_initcall(init_btrfs_fs);

Ahmet
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Filipe David Manana
On Sat, Feb 1, 2014 at 10:29 AM, Ahmet Inan
ai...@mathematik.uni-freiburg.de wrote:
 okay, putting late_initcall instead of module_init fixes it for me,
 but this is something you guys should decide how to handle:

 //module_init(init_btrfs_fs)
 late_initcall(init_btrfs_fs);

Thanks for reporting and testing Ahmet.

I tried late_initcall too, both when built as a module and as
built-in. Seems to work too on my hardware.
Out of curiosity, what error were you getting exactly? Can you paste
the stack trace from dmesg?



 Ahmet



-- 
Filipe David Manana,

Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Filipe David Manana
On Sat, Feb 1, 2014 at 5:25 PM, Ahmet Inan
ai...@mathematik.uni-freiburg.de wrote:
 I tried late_initcall too, both when built as a module and as
 built-in. Seems to work too on my hardware.
 On my i3 (avx) and i7 (avx2) systems it works well too.
 Havent tested other, faster pre avx systems, besides that intel u7300
 system, which gave me troubles, yet.

 Out of curiosity, what error were you getting exactly? Can you paste
 the stack trace from dmesg?
 I get no error at all. But also no btrfs in /proc/filesystems.

 Here a part of the dmesg, but i cant see anything from btrfs there,
 besides my own printk:

 printk(hello);
 err = btrfs_hash_init();

Did you find out what err's value was?

That could give some more insight, right now I don't fully understand
what happened.

Thanks


 ...
 [0.488837] sha1_ssse3: Neither AVX nor SSSE3 is available/usable.
 [0.489075] AVX instructions are not detected.
 [0.489284] AVX instructions are not detected.
 [0.490126] audit: initializing netlink socket (disabled)
 [0.490345] type=2000 audit(1391274060.489:1): initialized
 [0.518163] squashfs: version 4.0 (2009/01/31) Phillip Lougher
 [0.518626] Installing knfsd (copyright (C) 1996 o...@monad.swb.de).
 [0.518973] NTFS driver 2.1.30 [Flags: R/W].
 [0.519312] SGI XFS with security attributes, large block/inode
 numbers, no debug enabled
 [0.519989] NILFS version 2 loaded
 [0.520195] hello
 [0.520654] msgmni has been set to 3985
 [0.522639] NET: Registered protocol family 38
 [0.522948] Block layer SCSI generic (bsg) driver version 0.4
 loaded (major 250)
 [0.523364] io scheduler noop registered
 [0.523582] io scheduler deadline registered
 [0.523830] io scheduler cfq registered (default)
 ...

 And here, if i use late_initcall:

 ...
 [0.992166] Key type dns_resolver registered
 [0.993168] registered taskstats version 1
 [0.993752] hello
 [0.993932] bio: create slab bio-1 at 1
 [0.995293] Btrfs loaded
 [0.996004] rtc_cmos 00:00: setting system clock to 2014-02-01
 17:09:57 UTC (1391274597)
 [0.997902] Freeing unused kernel memory: 3060K (826f9000 -
 829f6000)
 ...

 Attached are both full dmesg logs.

 Ahmet



-- 
Filipe David Manana,

Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Ahmet Inan
 err = btrfs_hash_init();
 Did you find out what err's value was?
Its -2

Ahmet
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Btrfs: use late_initcall instead of module_init

2014-02-01 Thread Filipe David Borba Manana
It seems that when init_btrfs_fs() is called, crc32c/crc32c-intel might
not always be already initialized, which results in the call to 
crypto_alloc_shash()
returning -ENOENT, as experienced by Ahmet who reported this.

Therefore make sure init_btrfs_fs() is called after crc32c is initialized (which
is at initialization level 6, module_init), by using late_initcall (which is at
initialization level 7) instead of module_init for btrfs.

Reported-and-Tested-by: Ahmet Inan ai...@mathematik.uni-freiburg.de
Signed-off-by: Filipe David Borba Manana fdman...@gmail.com
---
 fs/btrfs/super.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c02f633..97cc241 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1996,7 +1996,7 @@ static void __exit exit_btrfs_fs(void)
btrfs_hash_exit();
 }
 
-module_init(init_btrfs_fs)
+late_initcall(init_btrfs_fs);
 module_exit(exit_btrfs_fs)
 
 MODULE_LICENSE(GPL);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-02-01 Thread Filipe David Manana
On Sat, Feb 1, 2014 at 7:42 PM, Ahmet Inan
ai...@mathematik.uni-freiburg.de wrote:
 err = btrfs_hash_init();
 Did you find out what err's value was?
 Its -2

Thanks, that was very helpful Ahmet.


 Ahmet



-- 
Filipe David Manana,

Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2014-02-01 Thread David Rientjes
On Thu, 30 Jan 2014, Chris Mason wrote:

 
 Hi Linus
 
 Please pull my for-linus branch:
 
 git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus
 
 There are two conflicts right now, one with the ACL code (pick your
 version) and one with Kent's changes in the block layer pull.  That one
 is pretty obvious too, just do both our cleanup and Kent's rework.
 
 This is a pretty big pull, and most of these changes have been floating
 in btrfs-next for a long time.  Filipe's properties work is a cool
 building block for inheriting attributes like compression down on a 
 per inode basis.
 
 Jeff Mahoney kicked in code to export filesystem info into sysfs.
 
 Otherwise, lots of performance improvements, cleanups and bug fixes.
 
 Looks like there are still a few other small pending incrementals, but I
 wanted to get the bulk of this in first.
 
 Filipe David Borba Manana (29) commits (+1856/-301):
 Btrfs: fix deadlock when iterating inode refs and running delayed inodes 
 (+12/-7)
 Btrfs: fix send file hole detection leading to data corruption (+15/-0)
 Btrfs: remove field tree_mod_seq_elem from btrfs_fs_info struct (+0/-1)
 Btrfs: make send's file extent item search more efficient (+17/-10)
 Btrfs: fix infinite path build loops in incremental send (+518/-21)
 Btrfs: reduce btree node locking duration on item update (+14/-10)
 Btrfs: return immediately if tree log mod is not necessary (+1/-1)
 Btrfs: fix pass of transid with wrong endianness in send.c (+3/-3)
 Btrfs: fix btrfs_search_slot_for_read backwards iteration (+3/-1)
 Btrfs: fix send to not send non-aligned clone operations (+2/-1)
 Btrfs: faster and more efficient extent map insertion (+41/-31)
 Btrfs: fix extent boundary check in bio_readpage_error (+1/-1)
 Btrfs: faster file extent item search in clone ioctl (+14/-9)
 Btrfs: unlock inodes in correct order in clone ioctl (+11/-3)
 Btrfs: faster file extent item replace operations (+114/-46)
 Btrfs: avoid unnecessary ordered extent cache resets (+2/-1)
 Btrfs: fix very slow inode eviction and fs unmount (+84/-14)
 Btrfs: fix snprintf usage by send's gen_unique_name (+1/-1)
 Btrfs: fix ordered extent check in btrfs_punch_hole (+1/-1)
 Btrfs: fix btrfs boot when compiled as built-in (+73/-9)

This one, 14a958e678cd (Btrfs: fix btrfs boot when compiled as 
built-in), breaks the build if CONFIG_LIBCRC32C=m:

fs/built-in.o: In function `btrfs_check_super_csum':
disk-io.c:(.text+0x1a1c8b): undefined reference to `crc32c'
fs/built-in.o: In function `write_dev_supers.isra.120':
disk-io.c:(.text+0x1a2054): undefined reference to `crc32c'
fs/built-in.o: In function `csum_tree_block.isra.122':
disk-io.c:(.text+0x1a22c4): undefined reference to `crc32c'
fs/built-in.o: In function `btrfs_csum_data':
(.text+0x1a2a46): undefined reference to `crc32c'
fs/built-in.o: In function `send_cmd':
send.c:(.text+0x20fe4c): undefined reference to `crc32c'
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2014-02-01 Thread Filipe David Manana
On Sun, Feb 2, 2014 at 12:15 AM, David Rientjes rient...@google.com wrote:
 On Thu, 30 Jan 2014, Chris Mason wrote:


 Hi Linus

 Please pull my for-linus branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus

 There are two conflicts right now, one with the ACL code (pick your
 version) and one with Kent's changes in the block layer pull.  That one
 is pretty obvious too, just do both our cleanup and Kent's rework.

 This is a pretty big pull, and most of these changes have been floating
 in btrfs-next for a long time.  Filipe's properties work is a cool
 building block for inheriting attributes like compression down on a
 per inode basis.

 Jeff Mahoney kicked in code to export filesystem info into sysfs.

 Otherwise, lots of performance improvements, cleanups and bug fixes.

 Looks like there are still a few other small pending incrementals, but I
 wanted to get the bulk of this in first.

 Filipe David Borba Manana (29) commits (+1856/-301):
 Btrfs: fix deadlock when iterating inode refs and running delayed inodes 
 (+12/-7)
 Btrfs: fix send file hole detection leading to data corruption (+15/-0)
 Btrfs: remove field tree_mod_seq_elem from btrfs_fs_info struct (+0/-1)
 Btrfs: make send's file extent item search more efficient (+17/-10)
 Btrfs: fix infinite path build loops in incremental send (+518/-21)
 Btrfs: reduce btree node locking duration on item update (+14/-10)
 Btrfs: return immediately if tree log mod is not necessary (+1/-1)
 Btrfs: fix pass of transid with wrong endianness in send.c (+3/-3)
 Btrfs: fix btrfs_search_slot_for_read backwards iteration (+3/-1)
 Btrfs: fix send to not send non-aligned clone operations (+2/-1)
 Btrfs: faster and more efficient extent map insertion (+41/-31)
 Btrfs: fix extent boundary check in bio_readpage_error (+1/-1)
 Btrfs: faster file extent item search in clone ioctl (+14/-9)
 Btrfs: unlock inodes in correct order in clone ioctl (+11/-3)
 Btrfs: faster file extent item replace operations (+114/-46)
 Btrfs: avoid unnecessary ordered extent cache resets (+2/-1)
 Btrfs: fix very slow inode eviction and fs unmount (+84/-14)
 Btrfs: fix snprintf usage by send's gen_unique_name (+1/-1)
 Btrfs: fix ordered extent check in btrfs_punch_hole (+1/-1)
 Btrfs: fix btrfs boot when compiled as built-in (+73/-9)

 This one, 14a958e678cd (Btrfs: fix btrfs boot when compiled as
 built-in), breaks the build if CONFIG_LIBCRC32C=m:

 fs/built-in.o: In function `btrfs_check_super_csum':
 disk-io.c:(.text+0x1a1c8b): undefined reference to `crc32c'
 fs/built-in.o: In function `write_dev_supers.isra.120':
 disk-io.c:(.text+0x1a2054): undefined reference to `crc32c'
 fs/built-in.o: In function `csum_tree_block.isra.122':
 disk-io.c:(.text+0x1a22c4): undefined reference to `crc32c'
 fs/built-in.o: In function `btrfs_csum_data':
 (.text+0x1a2a46): undefined reference to `crc32c'
 fs/built-in.o: In function `send_cmd':
 send.c:(.text+0x20fe4c): undefined reference to `crc32c'

One of the kbuild test robots reported this a few days ago too.
The following patch, sent shortly after the robot's warning, fixes it:

https://patchwork.kernel.org/patch/3554671/

thanks



-- 
Filipe David Manana,

Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2014-02-01 Thread David Rientjes
On Sun, 2 Feb 2014, Filipe David Manana wrote:

  Btrfs: fix btrfs boot when compiled as built-in (+73/-9)
 
  This one, 14a958e678cd (Btrfs: fix btrfs boot when compiled as
  built-in), breaks the build if CONFIG_LIBCRC32C=m:
 
  fs/built-in.o: In function `btrfs_check_super_csum':
  disk-io.c:(.text+0x1a1c8b): undefined reference to `crc32c'
  fs/built-in.o: In function `write_dev_supers.isra.120':
  disk-io.c:(.text+0x1a2054): undefined reference to `crc32c'
  fs/built-in.o: In function `csum_tree_block.isra.122':
  disk-io.c:(.text+0x1a22c4): undefined reference to `crc32c'
  fs/built-in.o: In function `btrfs_csum_data':
  (.text+0x1a2a46): undefined reference to `crc32c'
  fs/built-in.o: In function `send_cmd':
  send.c:(.text+0x20fe4c): undefined reference to `crc32c'
 
 One of the kbuild test robots reported this a few days ago too.
 The following patch, sent shortly after the robot's warning, fixes it:
 
 https://patchwork.kernel.org/patch/3554671/
 

Acked-by: David Rientjes rient...@google.com

Fixes the build problem for me, thanks!  This needs to get into 3.14 since 
the breakage is currently in Linus's tree.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html