From owner-svn-src-head@FreeBSD.ORG Tue Nov 20 08:17:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A3BEDD1; Tue, 20 Nov 2012 08:17:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 34A388FC08; Tue, 20 Nov 2012 08:17:34 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2787104lbb.13 for ; Tue, 20 Nov 2012 00:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zNk1flpvpJ3wuGKRYnb4H9lvUoMymjjZcI7u8UBkKPY=; b=ViCB7ExE1RAzz5OIBvFFU5YOAPMc6Mp6xvUgGQQ2GWgCQNbfrFgWeQlpDhEZxme8KM m7D5fSsJkrF8fFqtKcm0cc5S9GWmBJHH4QedrBtZ1mq4zUYiwaAZzg3X7tMo02k3d2rU LpY/xGVDy6KMvEhQpsYn4/N5zMitah0nOnuNz8eZ5V767q6HwBIyRk+qn0uvXfIdYIaM 3aQxRCBMHj9EJcAGwYxVpsp+MIvrB8W7CDN7jLF08Vf0t1Dx0M2HEt3bmf7RyVTubuyS gimUSJfPwQzHKFftxX6POrs9RswAEZFTfyY0JxZupCHCcPlqEpSxTCR8q3yz1cNnW3P7 9MRw== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr14016613lab.15.1353399453711; Tue, 20 Nov 2012 00:17:33 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 00:17:33 -0800 (PST) In-Reply-To: <20121120162708.I924@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> Date: Tue, 20 Nov 2012 08:17:33 +0000 X-Google-Sender-Auth: bg9E63SuNZp3UuwsOB8ET2OZdr8 Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2012 08:17:36 -0000 On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans wrote: > On Mon, 19 Nov 2012, Attilio Rao wrote: > >> Log: >> r16312 is not any longer real since many years (likely since when VFS >> received granular locking) but the comment present in UFS has been >> copied all over other filesystems code incorrectly for several times. >> >> Removes comments that makes no sense now. > > > It still made sense (except for bitrot in the function name), but might not > be true). The code made sense with it. Now the code makes no sense. > > >> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> >> ============================================================================== >> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >> (r243310) >> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >> (r243311) >> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >> ump = VFSTOUFS(mp); >> dev = ump->um_dev; >> fs = ump->um_fs; >> - >> - /* >> - * If this malloc() is performed after the getnewvnode() > > > This malloc() didn't match the code, which uses uma_zalloc(). Old > versions used MALLOC() in both the comment and the code. ffs's comment > was updated to say malloc() when the code was changed to use malloc(), > then rotted when the code was changed to use uma_zalloc(). In some > other file systems, the comment still said MALLOC(). > > >> - * it might block, leaving a vnode with a NULL v_data to be >> - * found by ffs_sync() if a sync happens to fire right then, >> - * which will cause a panic because ffs_sync() blindly >> - * dereferences vp->v_data (as well it should). >> - */ >> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >> >> /* Allocate a new vnode/inode. */ >> > > The code makes no sense now. The comment explains why ip is allocated > before vp, instead of in the natural, opposite order like it used to > be. Allocating things in an unnatural order requires extra code to > free ip when the allocation of vp fails. "Used to be" is very arguably. The code has been like its current form many more years than the opposite (16 against 3 I think). And the code makes perfectly sense if you know the history. So I don't agree with you. Thanks for the other comments, I will try to squeeze a patch about it. Attilio -- Peace can only be achieved by understanding - A. Einstein