From patchwork Sat Feb 1 21:27:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 3565341 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 477B09F2E9 for ; Sat, 1 Feb 2014 21:28:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 684D920295 for ; Sat, 1 Feb 2014 21:28:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EE932028D for ; Sat, 1 Feb 2014 21:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932830AbaBAV2f (ORCPT ); Sat, 1 Feb 2014 16:28:35 -0500 Received: from mail-we0-f177.google.com ([74.125.82.177]:38952 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932183AbaBAV2V (ORCPT ); Sat, 1 Feb 2014 16:28:21 -0500 Received: by mail-we0-f177.google.com with SMTP id t61so837383wes.22 for ; Sat, 01 Feb 2014 13:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=MRoICBPJ3T5NM3QYopB7LAiJ4Mz26vMtjtvXXUWFhLU=; b=unQyaSksXvG10dYH5qewxC8H63/9K1xI9jEU2Vn7CyZCStFu7/dkdxeH6aNG4Eqekv wr5UQyrTK8jc9yb3LCq+SbuX/ZorlWEbkkvGdcZ1iuQD2LLLmDvaMrlAhX+MhI1L8P1M moU8EsM77BohEi1Anr66Nnaj65Tmeao6384Vj0845eaAPaS/vyg17ahT20sTnXZfDXob Wg5SxtM2M05vdoYgIzyfGfuQgVAej7L2s+TbjEpEBiJXybxs0LxyTI4Lgo9WJ9E4fOTD tJXw0lGX/SzWHImy9ehg7fMsfVYKCvYxL7AbtStXNPSomc4TPkrw0IvZa7Od3u3+CoI8 1hfQ== X-Received: by 10.180.189.10 with SMTP id ge10mr3468332wic.47.1391290099540; Sat, 01 Feb 2014 13:28:19 -0800 (PST) Received: from storm-desktop.lan (bl10-140-184.dsl.telepac.pt. [85.243.140.184]) by mx.google.com with ESMTPSA id di9sm9976718wid.6.2014.02.01.13.28.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 13:28:19 -0800 (PST) From: Filipe David Borba Manana To: linux-btrfs@vger.kernel.org Cc: ainan@mathematik.uni-freiburg.de, Filipe David Borba Manana Subject: [PATCH] Btrfs: use late_initcall instead of module_init Date: Sat, 1 Feb 2014 21:27:56 +0000 Message-Id: <1391290076-13149-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Filipe David Borba Manana Tested-By: Tobias Klausmann --- 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");