Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ext2fs Swap byte order of ext2fs_direct fields in ex...



details:   https://anonhg.NetBSD.org/src/rev/730513f87623
branches:  trunk
changeset: 779211:730513f87623
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu May 10 19:08:34 2012 +0000

description:
Swap byte order of ext2fs_direct fields in ext2fs_rename_recalculate_fulr.

Symptom found and fix tested by martin.

ok martin

diffstat:

 sys/ufs/ext2fs/ext2fs_rename.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r d2857b268320 -r 730513f87623 sys/ufs/ext2fs/ext2fs_rename.c
--- a/sys/ufs/ext2fs/ext2fs_rename.c    Thu May 10 15:36:09 2012 +0000
+++ b/sys/ufs/ext2fs/ext2fs_rename.c    Thu May 10 19:08:34 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_rename.c,v 1.1 2012/05/09 00:21:18 riastradh Exp $      */
+/*     $NetBSD: ext2fs_rename.c,v 1.2 2012/05/10 19:08:34 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_rename.c,v 1.1 2012/05/09 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_rename.c,v 1.2 2012/05/10 19:08:34 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -658,12 +658,12 @@
                KASSERT(dirbuf_offset <= offset);
                ep = (struct ext2fs_direct *)
                    (dirbuf + (offset - dirbuf_offset));
-               reclen = ep->e2d_reclen;
+               reclen = fs2h16(ep->e2d_reclen);
 
                if (ep->e2d_ino == 0)
                        goto next;      /* Entry is unused.  */
 
-               if (ep->e2d_ino == WINO)
+               if (fs2h32(ep->e2d_ino) == WINO)
                        goto next;      /* Entry is whiteout.  */
 
                if (fcnp->cn_namelen != ep->e2d_namlen)



Home | Main Index | Thread Index | Old Index