have to take off the hash list when bread of inode fails
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 4 May 1990 05:41:08 +0000 (21:41 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 4 May 1990 05:41:08 +0000 (21:41 -0800)
SCCS-vsn: sys/ufs/ffs/ffs_inode.c 7.31
SCCS-vsn: sys/ufs/ffs/ufs_inode.c 7.31
SCCS-vsn: sys/ufs/lfs/lfs_inode.c 7.31
SCCS-vsn: sys/ufs/ufs/ufs_inode.c 7.31

usr/src/sys/ufs/ffs/ffs_inode.c
usr/src/sys/ufs/ffs/ufs_inode.c
usr/src/sys/ufs/lfs/lfs_inode.c
usr/src/sys/ufs/ufs/ufs_inode.c

index b0d6fdb..9d07ef1 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ffs_inode.c 7.30 (Berkeley) %G%
+ *     @(#)ffs_inode.c 7.31 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -142,6 +142,14 @@ loop:
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
+               /*
+                * The inode does not contain anything useful, so it would
+                * be misleading to leave it on its hash chain.
+                * Iput() will take care of putting it back on the free list.
+                */
+               remque(ip);
+               ip->i_forw = ip;
+               ip->i_back = ip;
                /*
                 * Unlock and discard unneeded inode.
                 */
                /*
                 * Unlock and discard unneeded inode.
                 */
index c02f473..0e0acd8 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_inode.c 7.30 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.31 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -142,6 +142,14 @@ loop:
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
+               /*
+                * The inode does not contain anything useful, so it would
+                * be misleading to leave it on its hash chain.
+                * Iput() will take care of putting it back on the free list.
+                */
+               remque(ip);
+               ip->i_forw = ip;
+               ip->i_back = ip;
                /*
                 * Unlock and discard unneeded inode.
                 */
                /*
                 * Unlock and discard unneeded inode.
                 */
index 2f6b348..0ede3da 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)lfs_inode.c 7.30 (Berkeley) %G%
+ *     @(#)lfs_inode.c 7.31 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -142,6 +142,14 @@ loop:
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
+               /*
+                * The inode does not contain anything useful, so it would
+                * be misleading to leave it on its hash chain.
+                * Iput() will take care of putting it back on the free list.
+                */
+               remque(ip);
+               ip->i_forw = ip;
+               ip->i_back = ip;
                /*
                 * Unlock and discard unneeded inode.
                 */
                /*
                 * Unlock and discard unneeded inode.
                 */
index c02f473..0e0acd8 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_inode.c 7.30 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.31 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -142,6 +142,14 @@ loop:
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
         */
        if (error = bread(VFSTOUFS(mntp)->um_devvp, fsbtodb(fs, itod(fs, ino)),
            (int)fs->fs_bsize, NOCRED, &bp)) {
+               /*
+                * The inode does not contain anything useful, so it would
+                * be misleading to leave it on its hash chain.
+                * Iput() will take care of putting it back on the free list.
+                */
+               remque(ip);
+               ip->i_forw = ip;
+               ip->i_back = ip;
                /*
                 * Unlock and discard unneeded inode.
                 */
                /*
                 * Unlock and discard unneeded inode.
                 */