mkfs.ext2 mkfs.vfat 格式化u盘时失败

今天在linux格式化时碰到个问题:

mkfs.vfat: lseek: Value too large for defined data type


传说中的解决如下:

I solved my problem for lseek() call. 


The followings is a patch. 


>> linux kernel. 

--- a/arch/openrisc/include/asm/unistd.h 
+++ b/arch/openrisc/include/asm/unistd.h 
@@ -35,4 +35,9 @@ 
#define __NR_or1k_atomic __NR_arch_specific_syscall 
__SYSCALL(__NR_or1k_atomic, sys_or1k_atomic) 

+#define __NR__llseek (__NR_arch_specific_syscall+1) 
+__SYSCALL(__NR__llseek, sys_llseek) 



#endif /* __ASM_OPENRISC_UNISTD_H */ 

--- a/include/asm-generic/unistd.h 
+++ b/include/asm-generic/unistd.h 
@@ -198,8 +198,7 @@ __SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64) 

/* fs/read_write.c */ 
#define __NR3264_lseek 62 
-//__SC_3264(__NR3264_lseek, sys_llseek, sys_lseek) 
-__SYSCALL(__NR3264_lseek, sys_llseek) 
+__SC_3264(__NR3264_lseek, sys_llseek, sys_lseek) 
#define __NR_read 63 
__SYSCALL(__NR_read, sys_read) 
#define __NR_write 64 
@@ -780,8 +779,8 @@ __SYSCALL(__NR_newfstatat, sys_newfstatat) 
__SYSCALL(__NR_fstatfs, sys_fstatfs) 
#define __NR_statfs 1056 
__SYSCALL(__NR_statfs, sys_statfs) 
-#define __NR_lseek 1057 
-__SYSCALL(__NR_lseek, sys_lseek) //for test. 
+//#define __NR_lseek 1057 
+//__SYSCALL(__NR_lseek, sys_lseek) 
#define __NR_mmap 1058 
__SYSCALL(__NR_mmap, sys_mmap) 

>> uClibc 
===================================================== 
--- a/uClibc/libc/sysdeps/linux/common/llseek.c 
+++ b/uClibc/libc/sysdeps/linux/common/llseek.c 
@@ -15,9 +15,12 @@ 

loff_t lseek64(int fd, loff_t offset, int whence) 

- loff_t result; 
- return (loff_t)(INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32), 
+ loff_t result,ret; 

+ ret = (INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32), 
(off_t) (offset & 0xffffffff), &result, whence) ?: result); 

+ return result; 


#else

你可能感兴趣的:(mkfs.ext2 mkfs.vfat 格式化u盘时失败)