From owner-freebsd-current Mon Sep 28 07:47:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA19556 for freebsd-current-outgoing; Mon, 28 Sep 1998 07:47:29 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sicily.odyssey.cs.cmu.edu (SICILY.ODYSSEY.CS.CMU.EDU [128.2.185.138]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA19547 for ; Mon, 28 Sep 1998 07:47:21 -0700 (PDT) (envelope-from rvb+@sicily.odyssey.cs.cmu.edu) To: Terry Lambert Cc: current@FreeBSD.ORG, dyson@iquest.net Subject: Re: VM question Re m->valid ... References: <199809272219.PAA01759@usr05.primenet.com> From: "Robert V. Baron" Date: 28 Sep 1998 10:46:45 -0400 In-Reply-To: Terry Lambert's message of Sun, 27 Sep 1998 22:19:08 +0000 (GMT) Message-ID: Lines: 59 X-Mailer: Gnus v5.4.46/Emacs 19.34 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The change mentioned below does not solve my problem. I have two ways to go. I'd like feed back and will commit something later today. There are two ways to go. One is to have vnode_pager_input_old set m->valid iff there are no errors. This works fine for me. The down side is that it is touching possibly sensitive code close to a release. I don't think this is a problem because it looks like only coda, msdos and cd9660 use the vnode_pager_generic_getpage interface. The latter two provide a bmap function that does not appear to return 0. So I believe that vnode_pager_input_old is only currently called by Coda. The other solution is to make the coda VOP_GETPAGES routine set m->valid for all the pages it gets. This localizes the solution only to Coda. But there is a slight problem/feature here. Coda is also an lkm. To get access to the struct vm_page and the VM_PAGE_BITS_ALL macro, I need to include vm_page.h. This is very hard for an lkm, because vm_page.h #include's opt_vmpage.h. I don't know how to deal with this in an lkm. So I am forced to a solution of making a small function in vm_page.c, vm_page_set_valid, which does the work. Then I have to export the prototype in vm_extern.h (because I can't include vm_page.h as discussed above). This solution also works. So which way to go. Alternatives are also solicited. Terry Lambert writes: > > is from Robert V. Baron > > I have a file system (Coda) in FreeBSD -current that needs to be able > > to map/exec files. There are a couple ways of doing this. One way is > > to have coda_bmap() return an error which will then force, > > vnode_pager_generic_getpages() to call vnode_pager_input_old(). The > > latter function does a simple VOP_READ to get the data. It looks like > > it pretty much does the right thing. BUT it looks like it fails to > > set the m->valid flag in the page it just read. (So later when > > exec_map_first_page checks for m->valid == 0; it's sad and the exec > > aborts.) It looks like if you do the more complicated > > vnode_pager_generic_getpage() function, it will set valid. On the > > otherhand, it looks like that vm_fault() which also calls > > vm_pager_get_pages() does its own setting of m->valid. So my > > questions is: > > Should vnode_pager_input_old set m->valid and if not who > > should. > > > There are cases where the valid is being cleared when it ought > not to be, specifically, when clean_only is set. > > > Here is a patch from John Dyson which was never committed, for no > reason that I have been able to determine: > > Someone, please, commit this. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message