fix for unaligned access in loggen.c
authorAllan Randall <allanr@sgi.com>
Mon, 14 Aug 2006 03:51:29 +0000 (03:51 +0000)
committerAllan Randall <allanr@sgi.com>
Mon, 14 Aug 2006 03:51:29 +0000 (03:51 +0000)
Merge of master-melb:xfs-cmds:26761a by kenmcd.

  fix for unaligned access PV 954475

src/loggen.c

index daa773b2ebac325110013ba12212f0d7f8e8abd4..f0cf63ce5fb1d84edeeb4d09ed366a499848d655 100644 (file)
@@ -169,6 +169,7 @@ loggen_empty(int count)
     xlog_rec_header_t       *head;
     xlog_op_header_t        *op1, *op2, *op3, *op4, *op5;
     xfs_trans_header_t      *trans;
+    xfs_buf_log_format_t    blfs;
     xfs_buf_log_format_t    *blf;
     int                     *data;
     char                    *p;
@@ -236,12 +237,13 @@ loggen_empty(int count)
     INT_SET(op3->oh_flags,          ARCH_CONVERT, 0);
     INT_SET(op3->oh_res2,           ARCH_CONVERT, 0);
     /* an empty buffer too */
-    blf->blf_type       = XFS_LI_BUF;
-    blf->blf_size       = 2;
-    blf->blf_flags      = XFS_BLI_CANCEL;
-    blf->blf_blkno      = 1;
-    blf->blf_map_size   = 1;
-    blf->blf_data_map[0]= 0;
+    blfs.blf_type       = XFS_LI_BUF;
+    blfs.blf_size       = 2;
+    blfs.blf_flags      = XFS_BLI_CANCEL;
+    blfs.blf_blkno      = 1;
+    blfs.blf_map_size   = 1;
+    blfs.blf_data_map[0]= 0;
+    memcpy(blf, &blfs, sizeof(blfs));
     /* commit */
     INT_SET(op4->oh_tid,            ARCH_CONVERT, 0xb0c0d0d0);
     INT_SET(op4->oh_len,            ARCH_CONVERT, sizeof(int));