Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2001 12:30:09 +0100 (CET)
From:      Michal Mertl <mime@traveller.cz>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        dillon@freebsd.org, <sheldonh@starjuice.net>, <current@freebsd.org>
Subject:   Re: ntfs and sendfile problem (corrupted data)
Message-ID:  <Pine.BSF.4.41.0112311022170.16032-100000@prg.traveller.cz>
In-Reply-To: <3C2FD3FE.A58BFC85@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.41.0112311022170.16032-100000>