summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/root-tree.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-30 10:10:44 +0200
committerChris Mason <chris.mason@oracle.com>2012-08-28 22:53:26 +0200
commitdadd1105ca9a1e506c678e8e410e9623efdda821 (patch)
tree949d3c7e461fea1df29650fa7fd2c4da23f605f7 /fs/btrfs/root-tree.c
parentBtrfs: unlock on error in btrfs_delalloc_reserve_metadata() (diff)
downloadlinux-dadd1105ca9a1e506c678e8e410e9623efdda821.tar.xz
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/root-tree.c')
-rw-r--r--fs/btrfs/root-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 6bb465cca20f..10d8e4d88071 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -544,8 +544,8 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
struct timespec ct = CURRENT_TIME;
spin_lock(&root->root_times_lock);
- item->ctransid = trans->transid;
+ item->ctransid = cpu_to_le64(trans->transid);
item->ctime.sec = cpu_to_le64(ct.tv_sec);
- item->ctime.nsec = cpu_to_le64(ct.tv_nsec);
+ item->ctime.nsec = cpu_to_le32(ct.tv_nsec);
spin_unlock(&root->root_times_lock);
}