From owner-freebsd-fs@FreeBSD.ORG Sat Dec 10 16:49:47 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AC6E106566B; Sat, 10 Dec 2011 16:49:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1058FC08; Sat, 10 Dec 2011 16:49:42 +0000 (UTC) Received: by iakl21 with SMTP id l21so151228iak.13 for ; Sat, 10 Dec 2011 08:49:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=E9BjOd1Q07Dpi4MYw9Mt1t/zjuwFEgO9yOT5QlW5/vo=; b=B001R+6uqycajbRn9YMrinGKVe9zNgmp6m5M6xkBSLXsUQ/9//IGxpfboLQf2jBviB dbFWeXIDzkihlUeAtslktrcNxynPy+mDKo1OS9eqSh4N6ctcy1T3yPjg3AUTJvcmsNVk DcAI0/AM4hO8pcoi3V3fhO/CKCuwslQnktAxM= MIME-Version: 1.0 Received: by 10.42.151.68 with SMTP id d4mr6476483icw.36.1323535782748; Sat, 10 Dec 2011 08:49:42 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Sat, 10 Dec 2011 08:49:42 -0800 (PST) In-Reply-To: <4EE18901.7060800@FreeBSD.org> References: <20111208134307.GA5266@thorin> <4EE18901.7060800@FreeBSD.org> Date: Sat, 10 Dec 2011 17:49:42 +0100 X-Google-Sender-Auth: apY6p-o2-Cn2D9XIdV9W2ofnmzc Message-ID: From: Robert Millan To: "Andrey V. Elsukov" Content-Type: text/plain; charset=UTF-8 Cc: freebsd-fs@freebsd.org, Adrian Chadd Subject: Re: [PATCH] Wipe other file systems when creating new UFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2011 16:49:47 -0000 2011/12/9 Andrey V. Elsukov : > i think before erasing 512 kib you should at least check actual available > mediasize and don't use hardcoded 512 sector size. 2011/12/9 Andrey V. Elsukov : > sorry, now i see that you have used disk.d_bsize, not hardcoded. > But the check for mediasize is still needed. :) I think I'm actually checking for physical media size, in: mediasize = get_block_device_size(disk.d_fd); which is based on output from ioctl rather than file system data structures. Is that what you meant?