NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/51512: sbin/fsck_lfs/lfs.c Remove repeated assignments



>Number:         51512
>Category:       bin
>Synopsis:       sbin/fsck_lfs/lfs.c Remove repeated assignments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 27 20:05:00 +0000 2016
>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;



Home | Main Index | Thread Index | Old Index