From owner-freebsd-current Mon Dec 31 3:30:17 2001 Delivered-To: freebsd-current@freebsd.org Received: from prg.traveller.cz (prg.traveller.cz [193.85.2.77]) by hub.freebsd.org (Postfix) with ESMTP id CC63F37B405; Mon, 31 Dec 2001 03:30:10 -0800 (PST) Received: from prg.traveller.cz (localhost [127.0.0.1]) by prg.traveller.cz (8.12.1[KQ-CZ](1)/8.12.1/pukvis) with ESMTP id fBVBU9lk026770; Mon, 31 Dec 2001 12:30:09 +0100 (CET) Received: from localhost (mime@localhost) by prg.traveller.cz (8.12.1[KQ-CZ](1)/pukvis) with ESMTP id fBVBU90q026767; Mon, 31 Dec 2001 12:30:09 +0100 (CET) Date: Mon, 31 Dec 2001 12:30:09 +0100 (CET) From: Michal Mertl To: Terry Lambert Cc: dillon@freebsd.org, , Subject: Re: ntfs and sendfile problem (corrupted data) In-Reply-To: <3C2FD3FE.A58BFC85@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 30 Dec 2001, Terry Lambert wrote: > Michal Mertl wrote: > > > > I wrote about the issue once before but now I know more about the > > problem. > > > > I have ntfs partition mounted ro on current. I can read from it without > > problems. But I noticed I get corrupted data (the corrupted file has > > right size but contains mostly zeros) when using ftpd to read them. > > > > I'm pretty sure the problem is thus in sendfile(2) and/or ntfs fs support. > > The getpages() doesn't work like you think in NTFS. > Thanks for the info, but I wasn't thinking much about how it works. I just found there's something wrong. Matt suggested a fix to smbfs which I tweaked a bit to fit into ntfs_vnops.c source but it panics. my patch (-current&ntfs modified Matt's smbfs_vnops.c patch): --- ntfs_vnops.c.ori Mon Dec 31 11:16:04 2001 +++ ntfs_vnops.c Mon Dec 31 11:04:02 2001 @@ -85,6 +85,8 @@ static int ntfs_fsync __P((struct vop_fsync_args *ap)); static int ntfs_pathconf __P((void *)); +static int ntfs_createvobject __P((struct vop_createvobject_args *ap)); + int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */ static int @@ -741,6 +743,7 @@ { &vop_access_desc, (vop_t *)ntfs_access }, { &vop_close_desc, (vop_t *)ntfs_close }, + { &vop_createvobject_desc, (vop_t *)ntfs_createvobject }, { &vop_open_desc, (vop_t *)ntfs_open }, { &vop_readdir_desc, (vop_t *)ntfs_readdir }, { &vop_fsync_desc, (vop_t *)ntfs_fsync }, @@ -751,6 +754,17 @@ { NULL, NULL } }; + +static int +ntfs_createvobject(ap) + struct vop_createvobject_args /* { + struct vnode *vp; + struct ucred *cred; + struct thread *td; + } */ *ap; +{ + return(0); +} static struct vnodeopv_desc ntfs_vnodeop_opv_desc = ------------- This is backtrace : #0 dumpsys () at /usr/src/sys/kern/kern_shutdown.c:492 #1 0xc01c0800 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:335 #2 0xc01c0c4f in panic (fmt=0xc02a9f2a "from debugger") at /usr/src/sys/kern/kern_shutdown.c:634 #3 0xc0135af5 in db_panic (addr=-1071094807, have_addr=0, count=-1, modif=0xcace1a6c "") at /usr/src/sys/ddb/db_command.c:452 #4 0xc0135a95 in db_command (last_cmdp=0xc02f1b18, cmd_table=0xc02f1938, aux_cmd_tablep=0xc02e9b58, aux_cmd_tablep_end=0xc02e9b5c) at /usr/src/sys/ddb/db_command.c:348 #5 0xc0135b5f in db_command_loop () at /usr/src/sys/ddb/db_command.c:474 #6 0xc0137f83 in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_trap.c:72 #7 0xc0286178 in kdb_trap (type=3, code=0, regs=0xcace1b6c) at /usr/src/sys/i386/i386/db_interface.c:167 #8 0xc0292568 in trap (frame={tf_fs = 24, tf_es = -1070399472, tf_ds = 16, tf_edi = -898024444, tf_esi = 256, tf_ebp = -892462152, tf_isp = -892462184, tf_ebx = 514, tf_edx = -1070719377, tf_ecx = 32, tf_eax = 18, tf_trapno = 3, tf_err = 0, tf_eip = -1071094807, tf_cs = 8, tf_eflags = 70, tf_esp = -1070719393, tf_ss = -1070857413}) at /usr/src/sys/i386/i386/trap.c:585 #9 0xc02863e9 in Debugger (msg=0xc02c033b "panic") at machine/cpufunc.h:66 #10 0xc01c0c38 in panic ( fmt=0xc02c8820 "open: vmio vnode has no backing object after vn_open") at /usr/src/sys/kern/kern_shutdown.c:621 #11 0xc01fe31c in open (td=0xca793c04, uap=0xcace1d20) at /usr/src/sys/kern/vfs_syscalls.c:1203 #12 0xc0292e94 in syscall (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 134960050, tf_esi = 135049216, tf_ebp = -1077938904, tf_isp = -892461708, tf_ebx = 135057664, tf_edx = 135049216, tf_ecx = 135057664, tf_eax = 5, tf_trapno = 12, tf_err = 2, tf_eip = 134574035, tf_cs = 31, tf_eflags = 647, tf_esp = -1077938964, tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1150 #13 0xc02870ed in syscall_with_err_pushed () -------------- I think this wasn't the right patch, after all. > -- Terry > -- Michal Mertl mime@traveller.cz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message