NetBSD Problem Report #43560

From riastradh@joule.t.continuation.org  Fri Jul  2 20:37:48 2010
Return-Path: <riastradh@joule.t.continuation.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2691563BA69
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 Jul 2010 20:37:48 +0000 (UTC)
Message-Id: <20100702203743.12E221236@joule.t.continuation.org>
Date: Fri,  2 Jul 2010 20:37:43 +0000 (UTC)
From: Taylor R Campbell <campbell+netbsd@mumble.net>
Reply-To: Taylor R Campbell <campbell+netbsd@mumble.net>
To: gnats-bugs@gnats.NetBSD.org
Subject: writing to null device in unionfs fails
X-Send-Pr-Version: 3.95

>Number:         43560
>Category:       kern
>Synopsis:       writing to null device in unionfs fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    hannken
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 02 20:40:00 +0000 2010
>Closed-Date:    Thu Aug 11 06:07:45 +0000 2011
>Last-Modified:  Thu Aug 11 06:07:45 +0000 2011
>Originator:     Taylor R Campbell <campbell+netbsd@mumble.net>
>Release:        NetBSD 5.1_RC2
>Organization:
>Environment:
System: NetBSD ... 5.1_RC2 NetBSD 5.1_RC2 (RIAGATE) #0: Mon Jun 21 22:23:02 UTC 2010  root@.../obj/sys/arch/i386/compile/RIAGATE i386
Architecture: i386
Machine: i386
>Description:

	If /foo/null is a null device (like /dev/null), and /bar is
	mounted with

		mount -t union -o -b /foo /bar

	then

		echo x > /bar/null

	fails with EROFS, and

		echo x >> /bar/null

	causes a panic.  This is reproducible.

	Kernel configuration:

include "arch/i386/conf/GENERIC"
options 	FFS_EI		# FFS Endian Independent Support
options 	APPLE_UFS	# Apple UFS support in FFS
options 	GATEWAY		# packet forwarding
pseudo-device 	pf			# PF packet filter
pseudo-device 	pflog			# PF log if

>How-To-Repeat:

	# mkdir /foo
	# cp /dev/MAKEDEV /foo/
	# cd /foo
	# ./MAKEDEV all
	# mkdir /bar
	# mount -t union -o -b /foo /bar
	# echo foo > /bar/null
	-sh: cannot create /bar/null: read-only file system
	# echo foo >> /bar/null
	panic: union: missing upper layer in write

>Fix:

	Yes, please!

>Release-Note:

>Audit-Trail:
From: Antti Kantee <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43560 CVS commit: src/tests/fs/union
Date: Sat, 3 Jul 2010 12:08:37 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Sat Jul  3 12:08:37 UTC 2010

 Modified Files:
 	src/tests/fs/union: t_pr.c

 Log Message:
 Add xfail tests for two cases described in PR kern/43560.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/tests/fs/union/t_pr.c

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

From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43560 CVS commit: src
Date: Wed, 10 Aug 2011 06:27:02 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Wed Aug 10 06:27:02 UTC 2011

 Modified Files:
 	src/sys/fs/union: union_vnops.c
 	src/tests/fs/union: t_pr.c

 Log Message:
 For devices, sockets and fifos ignore setting the file size to zero to make
 open(..., O_TRUNC) happy and allow them to write through the lower layer.

 Fixes PR #43560 (writing to null device in unionfs fails)


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/sys/fs/union/union_vnops.c
 cvs rdiff -u -r1.7 -r1.8 src/tests/fs/union/t_pr.c

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

Responsible-Changed-From-To: kern-bug-people->hannken
Responsible-Changed-By: hannken@NetBSD.org
Responsible-Changed-When: Thu, 11 Aug 2011 06:07:45 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: open->closed
State-Changed-By: hannken@NetBSD.org
State-Changed-When: Thu, 11 Aug 2011 06:07:45 +0000
State-Changed-Why:
Fixed in tree.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.