Module Name: src Committed By: reinoud Date: Tue May 19 15:08:42 UTC 2009
Modified Files: src/sys/fs/udf: udf_subr.c Log Message: Forgot to use the udf_rw16() on the descriptor crc lengths of FID's! Also fix a few dubiously formatted checks. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/fs/udf/udf_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/udf/udf_subr.c diff -u src/sys/fs/udf/udf_subr.c:1.87 src/sys/fs/udf/udf_subr.c:1.88 --- src/sys/fs/udf/udf_subr.c:1.87 Wed Mar 18 16:00:21 2009 +++ src/sys/fs/udf/udf_subr.c Tue May 19 15:08:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_subr.c,v 1.87 2009/03/18 16:00:21 cegger Exp $ */ +/* $NetBSD: udf_subr.c,v 1.88 2009/05/19 15:08:42 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -29,7 +29,7 @@ #include <sys/cdefs.h> #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.87 2009/03/18 16:00:21 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.88 2009/05/19 15:08:42 reinoud Exp $"); #endif /* not lint */ @@ -2232,7 +2232,7 @@ fid->file_char = UDF_FILE_CHAR_DIR | UDF_FILE_CHAR_PAR; fid->icb = *parent; fid->icb.longad_uniqueid = udf_rw32((uint32_t) unique_id); - fid->tag.desc_crc_len = fidsize - UDF_DESC_TAG_LENGTH; + fid->tag.desc_crc_len = udf_rw16(fidsize - UDF_DESC_TAG_LENGTH); (void) udf_validate_tag_and_crc_sums((union dscrptr *) fid); return fidsize; @@ -4914,11 +4914,11 @@ /* only reuse entries that are wiped */ /* check if the len + loc are marked zero */ - if (udf_rw32(fid->icb.len != 0)) + if (udf_rw32(fid->icb.len) != 0) continue; if (udf_rw32(fid->icb.loc.lb_num) != 0) continue; - if (udf_rw16(fid->icb.loc.part_num != 0)) + if (udf_rw16(fid->icb.loc.part_num) != 0) continue; #endif /* UDF_COMPLETE_DELETE */ @@ -4986,7 +4986,7 @@ unix_to_udf_name((char *) fid->data + udf_rw16(fid->l_iu), &fid->l_fi, cnp->cn_nameptr, cnp->cn_namelen, &osta_charspec); - fid->tag.desc_crc_len = chosen_size - UDF_DESC_TAG_LENGTH; + fid->tag.desc_crc_len = udf_rw16(chosen_size - UDF_DESC_TAG_LENGTH); (void) udf_validate_tag_and_crc_sums((union dscrptr *) fid); /* writeout FID/update parent directory */