From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 10:32:40 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B17106564A; Fri, 8 Oct 2010 10:32:40 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9C0ED8FC12; Fri, 8 Oct 2010 10:32:39 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o98AWcN2004108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Oct 2010 12:32:38 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1286533958; bh=+xh7a4e6ZVBesbiiLhwjrVqcrAZKc5S78UR682JrPRA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=q+04UDjDzabUDQVwJM/oGfR6j1prBROBfLWiXMb3DcB2FGkpAmruvHVar0ML49Js8 HnHUBXTMHxm4WQjIIrNIue/3DuXcM2YrUXtMQ6Lx+4l6oEAzYmTkfCwMidGBcWabjr Bk3a3L9OA4Xff1wBtROffnjqJ17lSHauMraN+FU8= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o98AWcjD004107; Fri, 8 Oct 2010 12:32:38 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Fri, 8 Oct 2010 12:32:38 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Ivan Voras Message-ID: <20101008103238.GV65440@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Ivan Voras , Alexander Best , Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7gGkHNMELEOhSGF6" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alexander Best , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 10:32:40 -0000 --7gGkHNMELEOhSGF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, 04.10.2010 at 14:04:53 +0200, Ivan Voras wrote: > On 4 October 2010 13:42, Alexander Best wrote: > > > good point. ZFS should really be added to the list and LFS should go away. are > > there any other relevant filesystems without a fixed-block size that need to be > > mentioned? what about afs? or tmpfs? > > (it's not that the block sizes aren't fixed, it's that the assignment > of blocks to the file is not fixed). Review of attached patch, anyone? I didn't come up with a clever way to describe non-COW file systems :/ --7gGkHNMELEOhSGF6 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="rm.diff" Content-Transfer-Encoding: 8bit commit 1756b0548e6b18a88e58fad0d078a507c2d87422 Author: Ulrich Spörlein Date: Fri Oct 8 12:29:06 2010 +0200 rm(1): clarify that -P works only when the block allocation is static Suggested by: pjd, ivoras diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index f580d33..dfba07b 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd October 3, 2010 +.Dd October 8, 2010 .Dt RM 1 .Os .Sh NAME @@ -229,8 +229,8 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying file system is a fixed-block file -system. -UFS is a fixed-block file system, LFS is not. +option assumes that the underlying file system does not allocate new blocks +when writing to existing blocks. +This is true for UFS but not for ZFS, which is using Copy-On-Write. In addition, only regular files are overwritten, other types of files are not. diff --git a/bin/rm/rm.c b/bin/rm/rm.c index d9bd296..653833a 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -402,8 +402,8 @@ rm_file(char **argv) * This is a cheap way to *really* delete files. Note that only regular * files are deleted, directories (and therefore names) will remain. * Also, this assumes a fixed-block file system (like FFS, or a V7 or a - * System V file system). In a logging file system, you'll have to have - * kernel support. + * System V file system). In a logging or COW file system, you'll have to + * have kernel support. */ int rm_overwrite(char *file, struct stat *sbp) --7gGkHNMELEOhSGF6--