diff for duplicates of <20090416112308.GB26366@ZenIV.linux.org.uk> diff --git a/a/1.txt b/N1/1.txt index 06769bb..3d24311 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -30,7 +30,8 @@ Besides, 'int' is almost certainly a wrong type. I can buy 'u32', but... er... that's highly unidiomatic (and fairly common in your code below). Any reasons for that? -> + bh_fat > + vmufat_sb_bread(sb, nextblock); +> + bh_fat = +> + vmufat_sb_bread(sb, nextblock); > + if (!bh_fat) { > + error = -EIO; > + goto fail; @@ -38,7 +39,7 @@ Any reasons for that? > + > + do { > + fatdata = ((u16 *) bh_fat->b_data)[x]; -> + if (fatdata = FAT_UNALLOCATED) +> + if (fatdata == FAT_UNALLOCATED) > + break; /*empty block */ > + if (--x < 0) { > + put_bh(bh_fat); @@ -129,7 +130,8 @@ willing to use on public maillist, after all. > + goto release_bh; > + } > + -> + saved_file > + kmalloc(sizeof(struct vmufat_file_info), GFP_KERNEL); +> + saved_file = +> + kmalloc(sizeof(struct vmufat_file_info), GFP_KERNEL); > + if (!saved_file) { > + error = -ENOMEM; > + goto release_bh; @@ -140,7 +142,8 @@ willing to use on public maillist, after all. > + (vmudetails->dir_bnum - blck_read)) { > + /* move to next block in directory */ > + blck_read--; -> + if (vmudetails->dir_bnum - vmudetails->dir_len <> + blck_read) +> + if (vmudetails->dir_bnum - vmudetails->dir_len <= +> + blck_read) > + break; > + brelse(bh); > + bh = vmufat_sb_bread(sb, blck_read); @@ -153,12 +156,13 @@ willing to use on public maillist, after all. > + > + saved_file->ftype = bh->b_data[vmufat_index(i - 2)]; > + -> + if (saved_file->ftype = 0) +> + if (saved_file->ftype == 0) > + break; > + -> + saved_file->fblk > + le16_to_cpu(((u16 *) bh->b_data)[1 + +> + saved_file->fblk = +> + le16_to_cpu(((u16 *) bh->b_data)[1 + > + vmufat_index_16(i - 2)]); -> + if (saved_file->fblk = 0) +> + if (saved_file->fblk == 0) > + saved_file->fblk = VMUFAT_ZEROBLOCK; > + > + memcpy(saved_file->fname, @@ -194,7 +198,7 @@ WTF do we bother with that copying, anyway? > + > + vmudetails = sb->s_fs_info; > + nextblock = ino; -> + if (nextblock = VMUFAT_ZEROBLOCK) +> + if (nextblock == VMUFAT_ZEROBLOCK) > + nextblock = 0; > + > + /* Delete any previous list of blocks */ @@ -218,13 +222,13 @@ WTF do we bother with that copying, anyway? > + > + /* Find next block in the FAT - if there is one */ > + fatdata = vmufat_get_fat(sb, nextblock); -> + if (fatdata = FAT_UNALLOCATED) { +> + if (fatdata == FAT_UNALLOCATED) { > + printk(KERN_WARNING "VMUFAT: FAT table appears to have" > + " been corrupted.\n"); > + error = -EIO; > + goto unwind_out; > + } -> + if (fatdata = FAT_FILE_END) +> + if (fatdata == FAT_FILE_END) > + break; /*end of file */ > + nextblock = fatdata; > + } while (1); @@ -244,14 +248,14 @@ And you call *that* on every block allocation? > + if (le16_to_cpu(((u16 *) bh->b_data) __le16 *, please, and the same for other places like that. > + [(y % DIR_ENT_PER_BLK) * -> + DIR_REC_LEN / 2 + 0x01]) = ino) +> + DIR_REC_LEN / 2 + 0x01]) == ino) > + break; -> + if ((((u8 *) bh->b_data)[0x01 + z] = +> + if ((((u8 *) bh->b_data)[0x01 + z] == > + 0x00) & ~(sb->s_flags & MS_RDONLY)) > + inode->i_mode |= S_IWUGO; > + /* Is file executible - ie a game */ -> + if ((((u8 *) bh->b_data)[z] = +> + if ((((u8 *) bh->b_data)[z] == > + 0xcc) & ~(sb->s_flags & MS_NOEXEC)) > + inode->i_mode |= S_IXUGO; @@ -277,7 +281,7 @@ WTF for? Leave handling that to fs/super.c, please. > + > + do { > + fatdata = ((u16 *) bh_fat->b_data)[x]; -> + if (fatdata = FAT_UNALLOCATED) +> + if (fatdata == FAT_UNALLOCATED) > + free++; > + if (--x < 0) { > + brelse(bh_fat); diff --git a/a/content_digest b/N1/content_digest index 0d3fbd5..cfa2165 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\01239654768.6542.10.camel@localhost.localdomain\0" "From\0Al Viro <viro@zeniv.linux.org.uk>\0" "Subject\0Re: [RFC][patch] filesystem: Vmufat filesystem, version 4\0" - "Date\0Thu, 16 Apr 2009 11:23:09 +0000\0" + "Date\0Thu, 16 Apr 2009 12:23:09 +0100\0" "To\0Adrian McMenamin <adrian@newgolddream.dyndns.info>\0" "Cc\0linux-fsdevel <linux-fsdevel@vger.kernel.org>" LKML <linux-kernel@vger.kernel.org> @@ -40,7 +40,8 @@ "er... that's highly unidiomatic (and fairly common in your code below).\n" "Any reasons for that?\n" "\n" - "> +\tbh_fat > +\t vmufat_sb_bread(sb, nextblock);\n" + "> +\tbh_fat =\n" + "> +\t vmufat_sb_bread(sb, nextblock);\n" "> +\tif (!bh_fat) {\n" "> +\t\terror = -EIO;\n" "> +\t\tgoto fail;\n" @@ -48,7 +49,7 @@ "> +\n" "> +\tdo {\n" "> +\t\tfatdata = ((u16 *) bh_fat->b_data)[x];\n" - "> +\t\tif (fatdata = FAT_UNALLOCATED)\n" + "> +\t\tif (fatdata == FAT_UNALLOCATED)\n" "> +\t\t\tbreak;\t/*empty block */\n" "> +\t\tif (--x < 0) {\n" "> +\t\t\tput_bh(bh_fat);\n" @@ -139,7 +140,8 @@ "> +\t\tgoto release_bh;\n" "> +\t}\n" "> +\n" - "> +\tsaved_file > +\t kmalloc(sizeof(struct vmufat_file_info), GFP_KERNEL);\n" + "> +\tsaved_file =\n" + "> +\t kmalloc(sizeof(struct vmufat_file_info), GFP_KERNEL);\n" "> +\tif (!saved_file) {\n" "> +\t\terror = -ENOMEM;\n" "> +\t\tgoto release_bh;\n" @@ -150,7 +152,8 @@ "> +\t\t\t(vmudetails->dir_bnum - blck_read)) {\n" "> +\t\t\t/* move to next block in directory */\n" "> +\t\t\tblck_read--;\n" - "> +\t\t\tif (vmudetails->dir_bnum - vmudetails->dir_len <> +\t\t\t\tblck_read)\n" + "> +\t\t\tif (vmudetails->dir_bnum - vmudetails->dir_len <=\n" + "> +\t\t\t\tblck_read)\n" "> +\t\t\t\tbreak;\n" "> +\t\t\tbrelse(bh);\n" "> +\t\t\tbh = vmufat_sb_bread(sb, blck_read);\n" @@ -163,12 +166,13 @@ "> +\n" "> +\t\tsaved_file->ftype = bh->b_data[vmufat_index(i - 2)];\n" "> +\n" - "> +\t\tif (saved_file->ftype = 0)\n" + "> +\t\tif (saved_file->ftype == 0)\n" "> +\t\t\tbreak;\n" "> +\n" - "> +\t\tsaved_file->fblk > +\t\t le16_to_cpu(((u16 *) bh->b_data)[1 +\n" + "> +\t\tsaved_file->fblk =\n" + "> +\t\t le16_to_cpu(((u16 *) bh->b_data)[1 +\n" "> +\t\t\tvmufat_index_16(i - 2)]);\n" - "> +\t\tif (saved_file->fblk = 0)\n" + "> +\t\tif (saved_file->fblk == 0)\n" "> +\t\t\tsaved_file->fblk = VMUFAT_ZEROBLOCK;\n" "> +\n" "> +\t\tmemcpy(saved_file->fname,\n" @@ -204,7 +208,7 @@ "> +\n" "> +\tvmudetails = sb->s_fs_info;\n" "> +\tnextblock = ino;\n" - "> +\tif (nextblock = VMUFAT_ZEROBLOCK)\n" + "> +\tif (nextblock == VMUFAT_ZEROBLOCK)\n" "> +\t\tnextblock = 0;\n" "> +\n" "> +\t/* Delete any previous list of blocks */\n" @@ -228,13 +232,13 @@ "> +\n" "> +\t\t/* Find next block in the FAT - if there is one */\n" "> +\t\tfatdata = vmufat_get_fat(sb, nextblock);\n" - "> +\t\tif (fatdata = FAT_UNALLOCATED) {\n" + "> +\t\tif (fatdata == FAT_UNALLOCATED) {\n" "> +\t\t\tprintk(KERN_WARNING \"VMUFAT: FAT table appears to have\"\n" "> +\t\t\t\t\" been corrupted.\\n\");\n" "> +\t\t\terror = -EIO;\n" "> +\t\t\tgoto unwind_out;\n" "> +\t\t}\n" - "> +\t\tif (fatdata = FAT_FILE_END)\n" + "> +\t\tif (fatdata == FAT_FILE_END)\n" "> +\t\t\tbreak;\t/*end of file */\n" "> +\t\tnextblock = fatdata;\n" "> +\t} while (1);\n" @@ -254,14 +258,14 @@ "> +\t\t\t\tif (le16_to_cpu(((u16 *) bh->b_data)\n" "__le16 *, please, and the same for other places like that.\n" "> +\t\t\t\t\t[(y % DIR_ENT_PER_BLK) * \n" - "> +\t\t\t\t\tDIR_REC_LEN / 2 + 0x01]) = ino)\n" + "> +\t\t\t\t\tDIR_REC_LEN / 2 + 0x01]) == ino)\n" "> +\t\t\t\t\tbreak;\n" "\n" - "> +\t\t\tif ((((u8 *) bh->b_data)[0x01 + z] =\n" + "> +\t\t\tif ((((u8 *) bh->b_data)[0x01 + z] ==\n" "> +\t\t\t 0x00) & ~(sb->s_flags & MS_RDONLY))\n" "> +\t\t\t\tinode->i_mode |= S_IWUGO;\n" "> +\t\t\t/* Is file executible - ie a game */\n" - "> +\t\t\tif ((((u8 *) bh->b_data)[z] =\n" + "> +\t\t\tif ((((u8 *) bh->b_data)[z] ==\n" "> +\t\t\t 0xcc) & ~(sb->s_flags & MS_NOEXEC))\n" "> +\t\t\t\tinode->i_mode |= S_IXUGO;\n" "\n" @@ -287,7 +291,7 @@ "> +\n" "> +\tdo {\n" "> +\t\tfatdata = ((u16 *) bh_fat->b_data)[x];\n" - "> +\t\tif (fatdata = FAT_UNALLOCATED)\n" + "> +\t\tif (fatdata == FAT_UNALLOCATED)\n" "> +\t\t\tfree++;\n" "> +\t\tif (--x < 0) {\n" "> +\t\t\tbrelse(bh_fat);\n" @@ -329,4 +333,4 @@ "Overall: code badly needs deobfuscation before anything else can be done\n" with it. -8ec99aae88aef3007e30f2c2ff2da4724756511793d7fa17ea007a7eba1d1baf +2203f192448c1cc05ac75331c79e4935c50eacf4e6b854136a9a7eb73a47cdf6
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.