Re: knfsd

G. Allen Morris III (gam3@harpo.ixlabs.com)
Wed, 27 Jan 1999 13:25:23 -0800


This is a multipart MIME message.

--==_Exmh_-9950371760
Content-Type: text/plain; charset=us-ascii

James,

The `nfsd: RC_REPLSTAT/reply' messages and the Oops are not related.

The attachment should solve the oops.

check http://csua.berkeley.edu/~gam3/knfsd to get the latest
knfd user code. If this does not get rid of the
`RC_REPLSTAT/reply len' messages send me information
about the clients that are accessing the server.

Allen

>>>James Puckett said:
>
>
>
> I recently upgraded to 2.2 SMP w/ knfsd 2.2b37. I am
> getting hundreds of lines of the following message each
> minute.
>
> Jan 27 11:51:45 sarah kernel: nfsd: RC_REPLSTAT/reply len 26!
> Jan 27 11:51:45 sarah kernel: nfsd: RC_REPLSTAT/reply len 3!
> Jan 27 11:51:45 sarah kernel: nfsd: RC_REPLSTAT/reply len 26!
> Jan 27 11:51:45 sarah kernel: nfsd: RC_REPLSTAT/reply len 13!
> Jan 27 11:51:50 sarah last message repeated 14 times
> Jan 27 11:51:51 sarah kernel: nfsd: RC_REPLSTAT/reply len 52!

---------------------------------
G. Allen Morris III

--==_Exmh_-9950371760
Content-Type: text/plain; name="temp"; charset=us-ascii
Content-Description: nfsd-vfs.diff
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="temp"

--- linux-2.2.0.orig/fs/nfsd/vfs.c Tue Jan 19 11:22:18 1999
+++ linux/fs/nfsd/vfs.c Wed Jan 27 13:19:17 1999
@@ -988,6 +988,20 @@
}
=

/*
+ * We need to do a check-parent every time
+ * after we have locked the parent - to verify
+ * that the parent is still our parent and
+ * that we are still hashed onto it..
+ *
+ * This is requied in case two processes race
+ * on removing (or moving) the same entry: the
+ * parent lock will serialize them, but the
+ * other process will be too late..
+ */
+#define check_parent(dir, dentry) \
+ ((dir) =3D=3D (dentry)->d_parent->d_inode && !list_empty(&dentry->d_has=
h))
+
+/*
* This follows the model of double_lock() in the VFS.
*/
static inline void nfsd_double_down(struct semaphore *s1, struct semapho=
re *s2)
@@ -1048,6 +1062,10 @@
if (IS_ERR(odentry))
goto out_nfserr;
=

+ err =3D -ENOENT;
+ if (!odentry->d_inode)
+ goto out_dput_old;
+
ndentry =3D lookup_dentry(tname, dget(tdentry), 0);
err =3D PTR_ERR(ndentry);
if (IS_ERR(ndentry))
@@ -1057,13 +1075,18 @@
* Lock the parent directories.
*/
nfsd_double_down(&tdir->i_sem, &fdir->i_sem);
- /* N.B. check for parent changes after locking?? */
-
- err =3D vfs_rename(fdir, odentry, tdir, ndentry);
- if (!err && EX_ISSYNC(tfhp->fh_export)) {
- write_inode_now(fdir);
- write_inode_now(tdir);
- }
+ err =3D -ENOENT;
+ /* GAM3 check for parent changes after locking. */
+ if (check_parent(fdir, odentry) &&
+ check_parent(tdir, ndentry)) {
+
+ err =3D vfs_rename(fdir, odentry, tdir, ndentry);
+ if (!err && EX_ISSYNC(tfhp->fh_export)) {
+ write_inode_now(fdir);
+ write_inode_now(tdir);
+ }
+ } else
+ dprintk("nfsd: Caught eace in nfsd_rename");
DQUOT_DROP(fdir);
DQUOT_DROP(tdir);
=

@@ -1137,10 +1160,9 @@
if (!fhp->fh_pre_mtime)
fhp->fh_pre_mtime =3D dirp->i_mtime;
fhp->fh_locked =3D 1;
- /* CHECKME: Should we do something with the child? */
=

err =3D -ENOENT;
- if (rdentry->d_parent->d_inode =3D=3D dirp)
+ if (check_parent(dirp, rdentry))
err =3D vfs_rmdir(dirp, rdentry);
=

rdentry->d_count--;

--==_Exmh_-9950371760--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/