[patch] isofs/joliet broken on alpha

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Mon Feb 26 2001 - 12:31:41 EST


uni16_to_x8() loads unaligned u16 words, returning bogus file names
on an ev5 and older alpha CPUs...

Ivan.

--- 2.4.2-ac4/fs/isofs/joliet.c Fri Feb 9 22:29:44 2001
+++ linux/fs/isofs/joliet.c Mon Feb 26 17:06:54 2001
@@ -10,6 +10,7 @@
 #include <linux/nls.h>
 #include <linux/slab.h>
 #include <linux/iso_fs.h>
+#include <asm/unaligned.h>
 
 /*
  * Convert Unicode 16 to UTF8 or ASCII.
@@ -17,15 +18,15 @@
 static int
 uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
 {
- wchar_t *ip;
+ wchar_t *ip, ch;
         unsigned char *op;
 
         ip = uni;
         op = ascii;
 
- while (*ip && len) {
+ while ((ch = get_unaligned(ip)) && len) {
                 int llen;
- wchar_t ch = be16_to_cpu(*ip);
+ ch = be16_to_cpu(ch);
                 if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
                         op += llen;
                 else
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 21:00:11 EST