Folks
YAEGASHI Takeshi wrote:
> Yesterday, I had updated my kernel to the latest 2.4.0-test1
> from CVS, and /bin/mount(in Chiyonofuji-2000-05-16) had gotten
> not to work. On 2.3.99-pre9 kernel it worked well and I could
> mount ext2/vfat partitions of CF. Have anyone ever had a
> similar exprerience?
Yes. The problem appears to be caused by a fix which was put into the
generic mount code (in copy_mount_options). This now correctly checks
the address the user gave for the file system type. However this has
highlighted a bug in the SuperH code. __copy_user should return the
number of bytes not copied (ie 0 for a success). However the SH version
was returning EFAULT for a failure. The attached patch should fix
this.
Whether you would have seen the problem or not depends on which mount
executable you are using. It would only have been a problem if the
filesystem type name appeared in a page which did not have a valid page
immediatly after it.
Could somebody check my resoning? If its sound I'll check in, together
with the other changes.
Stuart
------------------------------------------------------------------------------
Index: include/asm-sh/uaccess.h
===================================================================
RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/uaccess.h,v
retrieving revision 1.5
diff -c -r1.5 uaccess.h
*** include/asm-sh/uaccess.h 2000/05/22 09:41:34 1.5
--- include/asm-sh/uaccess.h 2000/06/12 18:17:27
***************
*** 209,214 ****
--- 209,215 ----
extern void __put_user_unknown(void);
/* Generic arbitrary sized copy. */
+ /* Return the number of bytes NOT copied */
/* XXX: should be such that: 4byte and the rest. */
extern __inline__ __kernel_size_t
__copy_user(void *__to, const void *__from, __kernel_size_t __n)
***************
*** 230,246 ****
"3:\n\t"
"mov.l 5f, %1\n\t"
"jmp @%1\n\t"
! " mov %7, %0\n\t"
".balign 4\n"
"5: .long 2b\n"
".previous\n"
".section __ex_table,\"a\"\n"
" .balign 4\n"
! " .long 9b,3b\n"
! " .long 1b,2b\n"
".previous"
: "=r" (res), "=&z" (__dummy), "=r" (_f), "=r" (_t)
! : "2" (__from), "3" (__to), "0" (res), "i" (-EFAULT)
: "memory");
return res;
--- 231,247 ----
"3:\n\t"
"mov.l 5f, %1\n\t"
"jmp @%1\n\t"
! " add #1, %0\n\t"
".balign 4\n"
"5: .long 2b\n"
".previous\n"
".section __ex_table,\"a\"\n"
" .balign 4\n"
! " .long 9b,2b\n"
! " .long 1b,3b\n"
".previous"
: "=r" (res), "=&z" (__dummy), "=r" (_f), "=r" (_t)
! : "2" (__from), "3" (__to), "0" (res)
: "memory");
return res;
|