NetBSD Problem Report #51512
From www@NetBSD.org Tue Sep 27 20:02:28 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id E3A087A111
for <gnats-bugs@gnats.NetBSD.org>; Tue, 27 Sep 2016 20:02:27 +0000 (UTC)
Message-Id: <20160927200226.F19877A2AE@mollari.NetBSD.org>
Date: Tue, 27 Sep 2016 20:02:26 +0000 (UTC)
From: joseyluis@gmail.com
Reply-To: joseyluis@gmail.com
To: gnats-bugs@NetBSD.org
Subject: sbin/fsck_lfs/lfs.c Remove repeated assignments
X-Send-Pr-Version: www-1.0
>Number: 51512
>Category: bin
>Synopsis: sbin/fsck_lfs/lfs.c Remove repeated assignments
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: dholland
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 27 20:05:00 +0000 2016
>Closed-Date: Tue Jun 12 20:21:54 +0000 2018
>Last-Modified: Tue Jun 12 20:21:54 +0000 2018
>Originator: Jose Luis Rodriguez Garcia
>Release: current
>Organization:
>Environment:
Current
>Description:
lfs_raw_vget function:
ip->i_lfs_effnblks is assigned to zero. This value isn't used. Later in this function it is assigned the definitive value.
ip->i_number = ino; This assignment is repeated two times the same value in the function.
I have tested to build with a build.sh
>How-To-Repeat:
code review
>Fix:
pc2$ cvs diff -u lfs.c
Index: lfs.c
===================================================================
RCS file: /cvsroot/src/sbin/fsck_lfs/lfs.c,v
retrieving revision 1.72
diff -u -r1.72 lfs.c
--- lfs.c 16 Sep 2016 11:13:47 -0000 1.72
+++ lfs.c 27 Sep 2016 19:12:19 -0000
@@ -365,7 +365,6 @@
/* ip->i_vnode = vp; */
ip->i_number = ino;
ip->i_lockf = 0;
- ip->i_lfs_effnblks = 0;
ip->i_flag = 0;
/* Load inode block and find inode */
@@ -385,7 +384,6 @@
lfs_copy_dinode(fs, ip->i_din, dip);
brelse(bp, 0);
}
- ip->i_number = ino;
/* ip->i_devvp = fs->lfs_devvp; */
ip->i_lfs = fs;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->dholland
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Sat, 03 Dec 2016 10:44:19 +0000
Responsible-Changed-Why:
lfs
From: "Zafer Aydogan" <zafer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/51512 CVS commit: src/sbin/fsck_lfs
Date: Tue, 12 Jun 2018 20:12:22 +0000
Module Name: src
Committed By: zafer
Date: Tue Jun 12 20:12:22 UTC 2018
Modified Files:
src/sbin/fsck_lfs: lfs.c
Log Message:
Remove duplicate assignments.
Fixes PR bin/51512 by Jose Luis Rodriguez Garcia
To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sbin/fsck_lfs/lfs.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: zafer@NetBSD.org
State-Changed-When: Tue, 12 Jun 2018 20:21:54 +0000
State-Changed-Why:
Applied. Thank you Jose Luis Rodriguez Garcia!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.