Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2001 11:09:42 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Michal Mertl <mime@traveller.cz>
Cc:        dillon@freebsd.org, sheldonh@starjuice.net, current@freebsd.org
Subject:   Re: ntfs and sendfile problem (corrupted data)
Message-ID:  <3C30B7F6.C01CECCF@mindspring.com>
References:  <Pine.BSF.4.41.0112311230550.16032-100000@prg.traveller.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Michal Mertl wrote:
> Sorry to bloat the list but I forgot to mention that the panics occur when
> I actually try to read from ntfs partition (after appliing pach from
> previous email). cd works ok but ls panics the kernel.

You can't use the patch provided on NTFS.  It's doesn't make fake
backing objects.

The problem is that you are going to need an NTFS specific "getpages"
for reading.  If you do a write, you are also going to need a
"putpages"; for executables, this will not be necessary, since the
copy-on-write will assign anonymous pages to the dirtied ones, and
they will get swap assigned, if they need to be swapped out.

As I said, the easiest thing to do would be to not use "external"
mbufs in the sendfile case on NTFS.  Whether this ends up being a
check for an FS specific getpages, or you have an attribute bit
for use in all FS's that can tell the sendfile code to use the
old approach (non-external mbufs) for FS's implementing only
transient backing ubjects, is up to you.

A third approach, which I don't recommend, would be to make the
sendfile() code FS specific, so that it can use block-sized mbufs,
whatever they happen to be (this would hold a reference to the
block rather than the backing page, which would also "fix" the
problem).  I don't recommend the approach, since it would make
the mmap() and sendfile code rather slow, even if functional,
and doing page gathering could result in a significant speedup.

-- Terry

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?3C30B7F6.C01CECCF>