From owner-p4-projects@FreeBSD.ORG Thu Oct 22 17:24:21 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B4EA106568F; Thu, 22 Oct 2009 17:24:21 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 179501065670 for ; Thu, 22 Oct 2009 17:24:21 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F049B8FC12 for ; Thu, 22 Oct 2009 17:24:20 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MHOKZe052732 for ; Thu, 22 Oct 2009 17:24:20 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9MHOK3x052730 for perforce@freebsd.org; Thu, 22 Oct 2009 17:24:20 GMT (envelope-from truncs@FreeBSD.org) Date: Thu, 22 Oct 2009 17:24:20 GMT Message-Id: <200910221724.n9MHOK3x052730@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to truncs@FreeBSD.org using -f From: Aditya Sarawgi To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 169684 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 17:24:21 -0000 http://p4web.freebsd.org/chv.cgi?CH=169684 Change 169684 by truncs@aditya on 2009/10/22 17:24:07 Use local variables for i_ino which causes problems with shared lookups as each would trash the ino value in the inode and remove i_ino variable which becomes unused. Ref: http://svn.freebsd.org/viewvc/base?view=revision&revision=178420 Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_lookup.c#7 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/inode.h#3 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_lookup.c#7 (text+ko) ==== @@ -313,7 +313,7 @@ struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - ino_t saved_ino; + ino_t ino; int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->e2fs_bsize; @@ -332,6 +332,7 @@ * we watch for a place to put the new file in * case it doesn't already exist. */ + ino = 0; slotstatus = FOUND; slotfreespace = slotsize = slotneeded = 0; if ((nameiop == CREATE || nameiop == RENAME) && @@ -457,7 +458,7 @@ * reclen in ndp->ni_ufs area, and release * directory buffer. */ - dp->i_ino = ep->e2d_ino; + ino = ep->e2d_ino; dp->i_reclen = ep->e2d_reclen; goto found; } @@ -581,12 +582,12 @@ dp->i_count = 0; else dp->i_count = dp->i_offset - prevoff; - if (dp->i_number == dp->i_ino) { + if (dp->i_number == ino) { VREF(vdp); *vpp = vdp; return (0); } - if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, LK_EXCLUSIVE, + if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); /* @@ -619,9 +620,9 @@ * Careful about locking second inode. * This can only occur if the target is ".". */ - if (dp->i_number == dp->i_ino) + if (dp->i_number == ino) return (EISDIR); - if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, LK_EXCLUSIVE, + if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); *vpp = tdp; @@ -650,18 +651,17 @@ */ pdp = vdp; if (flags & ISDOTDOT) { - saved_ino = dp->i_ino; VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(vdp->v_mount, saved_ino, LK_EXCLUSIVE, &tdp); + error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp); vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) return (error); *vpp = tdp; - } else if (dp->i_number == dp->i_ino) { + } else if (dp->i_number == ino) { VREF(vdp); /* we want ourself, ie "." */ *vpp = vdp; } else { - if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, LK_EXCLUSIVE, + if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); *vpp = tdp; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/inode.h#3 (text+ko) ==== @@ -75,7 +75,6 @@ doff_t i_endoff; /* End of useful stuff in directory. */ doff_t i_diroff; /* Offset in dir, where we found last entry. */ doff_t i_offset; /* Offset of free space in directory. */ - ino_t i_ino; /* Inode number of found directory. */ u_int32_t i_reclen; /* Size of found directory entry. */ u_int32_t i_block_group;