NetBSD Problem Report #32166

From yamt@mwd.biglobe.ne.jp  Sat Nov 26 15:44:23 2005
Return-Path: <yamt@mwd.biglobe.ne.jp>
Received: from yamt.dyndns.org (FLA1Aaf173.kng.mesh.ad.jp [61.193.99.173])
	by narn.netbsd.org (Postfix) with ESMTP id E316963B86D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Nov 2005 15:44:22 +0000 (UTC)
Message-Id: <1133019815.909101.10024.nullmailer@yamt.dyndns.org>
Date: Sun, 27 Nov 2005 00:43:35 +0900
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@mwd.biglobe.ne.jp
To: gnats-bugs@netbsd.org
Subject: pgo_get protocol is ambiguous
X-Send-Pr-Version: 3.95

>Number:         32166
>Category:       kern
>Synopsis:       pgo_get protocol is ambiguous
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ad
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 26 15:45:00 +0000 2005
>Closed-Date:    Tue May 19 22:34:15 +0000 2020
>Last-Modified:  Tue May 19 22:34:15 +0000 2020
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 3.99.10
>Organization:

>Environment:


System: NetBSD kaeru 3.99.10 NetBSD 3.99.10 (build.kaeru.xen.nodebug) #22: Wed Nov 2 06:33:38 JST 2005 takashi@kaeru:/home/takashi/work/kernel/build.kaeru.xen.nodebug i386
Architecture: i386
Machine: i386
>Description:
	pgo_get of each pagers behaves somewhat differently.

	1. uvn_get ignores PGO_ALLPAGES.
	   uao_get alters its return value with it.

	2. in the case of !PGO_LOCKED, uvn_get ignores PGO_DONTCARE,
	   while uao_get honours it.

>How-To-Repeat:
	code inspection.
>Fix:
	i'd propose to:

	1. deprecate PGO_ALLPAGES for pgo_get because
	   it doesn't seem to make much sense.

	2. for !PGO_LOCKED requests, always ignore PGO_DONTCARE.
	   (ie. make "pps" output only, and remove memset() in callers.)

>Release-Note:

>Audit-Trail:
From: "Julio M. Merino Vidal" <jmmv84@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/32166
Date: Thu, 2 Nov 2006 13:04:11 +0100

 >        2. in the case of !PGO_LOCKED, uvn_get ignores PGO_DONTCARE,
 >           while uao_get honours it.

 Isn't that reversed?  I mean, it should be PGO_LOCKED because  AFAICS
 from uao_get, PGO_DONTCARE is honored in the PGO_LOCKED case (at least
 in uvm_aobj.c:951, v1.82).

 -- 
 Julio M. Merino Vidal <jmmv84@gmail.com>
 The Julipedia - http://julipedia.blogspot.com/

From: "Julio M. Merino Vidal" <jmmv@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/32166 CVS commit: src/sys/fs/tmpfs
Date: Thu,  2 Nov 2006 15:35:25 +0000 (UTC)

 Module Name:	src
 Committed By:	jmmv
 Date:		Thu Nov  2 15:35:25 UTC 2006

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs_vnops.c

 Log Message:
 Make tmpfs_getpages behave as genfs_getpages by ignoring the input pages
 array's contents and returning all the requested pages.  Otherwise there
 are problems (accessing invalid memory) when the a_m vector is passed
 uninitialized as the NFS server code does.  Fixes PR kern/34959.

 Note that this is not a "real" fix.  While this makes tmpfs's getpages
 operation consistent with the behavior of other file systems, it does
 not resolve the different semantics between uvn_get and uao_get as
 described in PR kern/32166.  I'm adding a comment in the code mentioning
 exactly this so that it can be reviewed when this last problem is
 addressed.


 To generate a diff of this commit:
 cvs rdiff -r1.27 -r1.28 src/sys/fs/tmpfs/tmpfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/32166
Date: Fri,  3 Nov 2006 00:59:22 +0900 (JST)

 > The following reply was made to PR kern/32166; it has been noted by GNATS.
 > 
 > From: "Julio M. Merino Vidal" <jmmv84@gmail.com>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/32166
 > Date: Thu, 2 Nov 2006 13:04:11 +0100
 > 
 >  >        2. in the case of !PGO_LOCKED, uvn_get ignores PGO_DONTCARE,
 >  >           while uao_get honours it.
 >  
 >  Isn't that reversed?  I mean, it should be PGO_LOCKED because  AFAICS
 >  from uao_get, PGO_DONTCARE is honored in the PGO_LOCKED case (at least
 >  in uvm_aobj.c:951, v1.82).

 i don't understand what you mean.
 in the case of PGO_LOCKED, uvn_get (genfs_getpages) honors PGO_DONTCARE.
 so there is no inconsistency between pagers.

 YAMAMOTO Takashi

Responsible-Changed-From-To: kern-bug-people->ad
Responsible-Changed-By: ad@NetBSD.org
Responsible-Changed-When: Tue, 19 May 2020 19:41:42 +0000
Responsible-Changed-Why:
This causes problems with NFS because tmpfs can now do pgo_get(PGO_LOCKED).


From: "Andrew Doran" <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/32166 CVS commit: src/sys
Date: Tue, 19 May 2020 22:22:15 +0000

 Module Name:	src
 Committed By:	ad
 Date:		Tue May 19 22:22:15 UTC 2020

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs_vnops.c
 	src/sys/uvm: uvm_aobj.c uvm_bio.c uvm_object.c uvm_pager.h uvm_vnode.c

 Log Message:
 PR kern/32166: pgo_get protocol is ambiguous
 Also problems with tmpfs+nfs noted by hannken@.

 Don't pass PGO_ALLPAGES to pgo_get, and ignore PGO_DONTCARE in the
 !PGO_LOCKED case.  In uao_get() have uvm_pagealloc() take care of page
 zeroing and release busy pages on error.


 To generate a diff of this commit:
 cvs rdiff -u -r1.140 -r1.141 src/sys/fs/tmpfs/tmpfs_vnops.c
 cvs rdiff -u -r1.141 -r1.142 src/sys/uvm/uvm_aobj.c
 cvs rdiff -u -r1.113 -r1.114 src/sys/uvm/uvm_bio.c
 cvs rdiff -u -r1.21 -r1.22 src/sys/uvm/uvm_object.c
 cvs rdiff -u -r1.48 -r1.49 src/sys/uvm/uvm_pager.h
 cvs rdiff -u -r1.112 -r1.113 src/sys/uvm/uvm_vnode.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: ad@NetBSD.org
State-Changed-When: Tue, 19 May 2020 22:34:15 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.