From patchwork Fri Mar 18 22:56:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 645671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2IMvAde029295 for ; Fri, 18 Mar 2011 22:57:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757448Ab1CRW5H (ORCPT ); Fri, 18 Mar 2011 18:57:07 -0400 Received: from twin.jikos.cz ([89.185.236.188]:50695 "EHLO twin.jikos.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488Ab1CRW5G (ORCPT ); Fri, 18 Mar 2011 18:57:06 -0400 Received: from twin.jikos.cz (dave@localhost [127.0.0.1]) by twin.jikos.cz (8.13.6/8.13.6) with ESMTP id p2IMui1Z008069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Mar 2011 23:56:44 +0100 Received: (from dave@localhost) by twin.jikos.cz (8.13.6/8.13.6/Submit) id p2IMuhSQ008068; Fri, 18 Mar 2011 23:56:43 +0100 Date: Fri, 18 Mar 2011 23:56:43 +0100 From: David Sterba To: Chris Mason Cc: David Sterba , linux-btrfs , "adrien.dessemond" Subject: Re: [PATCH] btrfs: properly access unaligned checksum buffer Message-ID: <20110318225643.GY17108@twin.jikos.cz> Reply-To: dave@jikos.cz Mail-Followup-To: Chris Mason , David Sterba , linux-btrfs , "adrien.dessemond" References: <1300462105-30680-1-git-send-email-dsterba@suse.cz> <1300463770-sup-1372@think> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1300463770-sup-1372@think> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Mar 2011 22:57:22 +0000 (UTC) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index e1aa8d6..80a6830 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "compat.h" #include "ctree.h" #include "disk-io.h" @@ -198,7 +199,7 @@ u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len) void btrfs_csum_final(u32 crc, char *result) { - *(__le32 *)result = ~cpu_to_le32(crc); + put_unaligned_le32(~crc, result); } /*