On Mon, Nov 01, 2004 at 09:01:11PM +0000, Richard Allen wrote:
> On Mon, Nov 01, 2004 at 08:39:58PM +0000, Richard Allen wrote:
>
> > Continue? (Y/N) Y
> > The specified disk did not finish formatting.
> > Internal error3: Format failed rc=ffffffff
>
> Running mkfs.jfs in strace gives:
>
> write(3, "!Ce\207\1\0\0\0\0\0\0\0\0 \0\0\0\20\0\0\f\0\0\0\0\t \20"..., 4096) = -1
> EFAULT (Bad address)
I'm sorry if I'm mailbombing you guys. But I think I found the problem.
I traced the problem to ujfs_rw_diskblocks() in libfs/devices.c
EFAULT in write() means the buffer to write is outside my accessible address
space.
The function jfs_logform() has a structure defined called log_sup of type
logsuper and it's defined as static. It's then used as argument 4 to the
function ujfs_rw_diskblocks() which is located in another file.
rc = ujfs_rw_diskblocks(fd, (log_begin + LOGPSIZE),
(unsigned) LOGPSIZE, (char *) &log_sup, PUT);
in ujfs_rw_diskblocks argument 4 becomes void *data_buffer which is used
in read and write functions.
case PUT:
Bytes_Transferred = write(dev_ptr, data_buffer, disk_count);
break;
After making the structure non static, it formats perfectly:
[EMAIL PROTECTED] jfsutils-1.1.7]# ./mkfs/jfs_mkfs /dev/vg00/lvol7
./mkfs/jfs_mkfs version 1.1.7, 22-Jul-2004
Warning! All data on device /dev/vg00/lvol7 will be lost!
Continue? (Y/N) Y
\
Format completed successfully.
111931392 kilobytes total disk space.
[EMAIL PROTECTED] jfsutils-1.1.7]# ./fsck/jfs_fsck -f /dev/vg00/lvol7
./fsck/jfs_fsck version 1.1.7, 22-Jul-2004
processing started: 11/1/2004 21.29.0
The current device is: /dev/vg00/lvol7
Block size in bytes: 4096
Filesystem size in blocks: 27982848
**Phase 0 - Replay Journal Log
**Phase 1 - Check Blocks, Files/Directories, and Directory Entries
**Phase 2 - Count links
**Phase 3 - Duplicate Block Rescan and Directory Connectedness
**Phase 4 - Report Problems
**Phase 5 - Check Connectivity
**Phase 6 - Perform Approved Corrections
**Phase 7 - Rebuild File/Directory Allocation Maps
**Phase 8 - Rebuild Disk Allocation Maps
111931392 kilobytes total disk space.
0 kilobytes in 1 directories.
0 kilobytes in 0 user files.
0 kilobytes in extended attributes
50192 kilobytes reserved for system use.
111881200 kilobytes are available for use.
Filesystem is clean.
I'd like to know if I'm right before I put this into production ;) So If
you feel I'm not making any sense at all, please let me know :)
--
Rikki. -- RHCE, RHCX, HP-UX Certified Administrator.
-- Solaris 7 Certified Systems and Network Administrator.
Bell Labs Unix -- Reach out and grep someone.
Those who do not understand Unix are condemned to reinvent it, poorly.
_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion