summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorDan Carpenter2012-07-30 10:10:44 +0200
committerChris Mason2012-08-28 22:53:26 +0200
commitdadd1105ca9a1e506c678e8e410e9623efdda821 (patch)
tree949d3c7e461fea1df29650fa7fd2c4da23f605f7 /fs/btrfs/transaction.c
parentBtrfs: unlock on error in btrfs_delalloc_reserve_metadata() (diff)
downloadkernel-qcow2-linux-dadd1105ca9a1e506c678e8e410e9623efdda821.tar.gz
kernel-qcow2-linux-dadd1105ca9a1e506c678e8e410e9623efdda821.tar.xz
kernel-qcow2-linux-dadd1105ca9a1e506c678e8e410e9623efdda821.zip
Btrfs: fix some endian bugs handling the root times
"trans->transid" is cpu endian but we want to store the data as little endian. "item->ctime.nsec" is only 32 bits, not 64. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 7ac7cdcc294e..7208ada41e0e 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1061,7 +1061,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
memcpy(new_root_item->parent_uuid, root->root_item.uuid,
BTRFS_UUID_SIZE);
new_root_item->otime.sec = cpu_to_le64(cur_time.tv_sec);
- new_root_item->otime.nsec = cpu_to_le64(cur_time.tv_nsec);
+ new_root_item->otime.nsec = cpu_to_le32(cur_time.tv_nsec);
btrfs_set_root_otransid(new_root_item, trans->transid);
memset(&new_root_item->stime, 0, sizeof(new_root_item->stime));
memset(&new_root_item->rtime, 0, sizeof(new_root_item->rtime));