patch for 2.1.81 bad_inode.c

Bill Hawes (whawes@star.net)
Sun, 25 Jan 1998 13:03:13 -0500


This is a multi-part message in MIME format.
--------------682B62FAD81825BA4E6F34B9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The current bad_inode code is a little too draconian in that returning error
from the follow-link operation prevents a lookup on a directory. If the root
inode of a fs then gets marked bad because of a network error or whatever, the
follow_link error prevents the fs from being unmounted.

The attached patch turns the follow_link operation into a no-op instead of
returning an error, and adds error entries for update_page and revalidate.

Regards,
Bill
--------------682B62FAD81825BA4E6F34B9
Content-Type: text/plain; charset=us-ascii; name="bad_inode81-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="bad_inode81-patch"

--- fs/bad_inode.c.old Tue Jan 6 11:39:05 1998
+++ fs/bad_inode.c Sun Jan 25 13:48:27 1998
@@ -11,12 +11,14 @@
#include <linux/sched.h>

/*
- * The follow_symlink operation must dput() the base.
+ * The follow_link operation is special: it must behave as a no-op
+ * so that a bad root inode can at least be unmounted. To do this
+ * we must dput() the base and return the dentry with a dget().
*/
static struct dentry * bad_follow_link(struct dentry *dent, struct dentry *base)
{
dput(base);
- return ERR_PTR(-EIO);
+ return dget(dent);
}

static int return_EIO(void)
@@ -62,7 +64,9 @@
EIO_ERROR, /* bmap */
EIO_ERROR, /* truncate */
EIO_ERROR, /* permission */
- EIO_ERROR /* smap */
+ EIO_ERROR, /* smap */
+ EIO_ERROR, /* update_page */
+ EIO_ERROR /* revalidate */
};


--------------682B62FAD81825BA4E6F34B9--