summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/root-tree.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-30 02:10:44 -0600
committerChris Mason <chris.mason@oracle.com>2012-08-28 16:53:26 -0400
commitdadd1105ca9a1e506c678e8e410e9623efdda821 (patch)
tree949d3c7e461fea1df29650fa7fd2c4da23f605f7 /fs/btrfs/root-tree.c
parent55e591ffde38e0088b022129e035e18a8d04c7e6 (diff)
downloadop-kernel-dev-dadd1105ca9a1e506c678e8e410e9623efdda821.zip
op-kernel-dev-dadd1105ca9a1e506c678e8e410e9623efdda821.tar.gz
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 6bb465c..10d8e4d 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);
}
OpenPOWER on IntegriCloud