History

[PATCH] mtd: 64 bit fixes

Fix some bugs in mtd/jffs2 on 64bit platform. The MEMGETBADBLOCK/MEMSETBADBLOCK ioctl are not listed in compat_ioctl.h. And some variables in jffs2 are declared as uint32_t but used to hold size_t values.

Atsushi Nemoto committed 20 years ago

Commit 0ef675d1 parent eff2c2f3 files · +5 −2Browse files

Unified · Split

3 files
  1. fs/jffs2/nodelist.c +2 −1
  2. fs/jffs2/readinode.c +1 −1
  3. include/linux/compat_ioctl.h +2 −0
fs/jffs2/nodelist.c+2−1
@@ -406,7 +406,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info · 405 unmodified lines
406 int err = 0, pointed = 0;406 int err = 0, pointed = 0;
407 struct jffs2_eraseblock *jeb;407 struct jffs2_eraseblock *jeb;
408 unsigned char *buffer;408 unsigned char *buffer;
409 uint32_t crc, ofs, retlen, len;409 uint32_t crc, ofs, len;
410 size_t retlen;
410 411
411 BUG_ON(tn->csize == 0);412 BUG_ON(tn->csize == 0);
412 413
fs/jffs2/readinode.c+1−1
@@ -112,7 +112,7 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r · 111 unmodified lines
112 * negative error code on failure.112 * negative error code on failure.
113 */113 */
114static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,114static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,
115 struct jffs2_raw_dirent *rd, uint32_t read, struct jffs2_full_dirent **fdp,115 struct jffs2_raw_dirent *rd, size_t read, struct jffs2_full_dirent **fdp,
116 uint32_t *latest_mctime, uint32_t *mctime_ver)116 uint32_t *latest_mctime, uint32_t *mctime_ver)
117{117{
118 struct jffs2_full_dirent *fd;118 struct jffs2_full_dirent *fd;
include/linux/compat_ioctl.h+2−0
@@ -696,6 +696,8 @@ COMPATIBLE_IOCTL(MEMLOCK) · 695 unmodified lines
696COMPATIBLE_IOCTL(MEMUNLOCK)696COMPATIBLE_IOCTL(MEMUNLOCK)
697COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)697COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
698COMPATIBLE_IOCTL(MEMGETREGIONINFO)698COMPATIBLE_IOCTL(MEMGETREGIONINFO)
699COMPATIBLE_IOCTL(MEMGETBADBLOCK)
700COMPATIBLE_IOCTL(MEMSETBADBLOCK)
699/* NBD */701/* NBD */
700ULONG_IOCTL(NBD_SET_SOCK)702ULONG_IOCTL(NBD_SET_SOCK)
701ULONG_IOCTL(NBD_SET_BLKSIZE)703ULONG_IOCTL(NBD_SET_BLKSIZE)