From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 1 Mar 2001 09:13:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 1 Mar 2001 09:13:18 -0500 Received: from mons.uio.no ([129.240.130.14]:31140 "EHLO mons.uio.no") by vger.kernel.org with ESMTP id ; Thu, 1 Mar 2001 09:13:07 -0500 Message-ID: <15006.22766.586401.216994@charged.uio.no> Date: Thu, 1 Mar 2001 15:13:02 +0100 (CET) To: "Patrick J. LoPresti" Cc: Linux Kernel Subject: Re: Stale NFS handles on 2.4.2^H^H^H^H^H2.2.19 In-Reply-To: In-Reply-To: <20010214002750.B11906@unthought.net> <20010224141855.B12988@d-131-151-189-65.dynamic.umr.edu> <15000.39826.947692.141119@notabene.cse.unsw.edu.au> <20010224235342.D483@d-131-151-189-65.dynamic.umr.edu> <15000.53110.664338.230709@notabene.cse.unsw.edu.au> <20010225131013.E483@d-131-151-189-65.dynamic.umr.edu> <15004.16978.439300.108625@notabene.cse.unsw.edu.au> <15005.30849.720697.525157@notabene.cse.unsw.edu.au> <15005.41548.370345.60631@charged.uio.no> <20010228211808.C24668@d-131-151-189-65.dynamic.umr.edu> <15006.4414.116135.500744@charged.uio.no> X-Mailer: VM 6.75 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: trond.myklebust@fys.uio.no From: Trond Myklebust Mime-Version: 1.0 (generated by tm-edit 1.7) Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org >>>>> " " == Patrick J LoPresti writes: > Trond Myklebust writes: >> OK. We need the patch I sent last night plus a 1-liner in >> nfs_inode_is_stale(). That should cover both pathologies. It'll >> probably clean up the other cases in which people have been >> reporting -ESTALE errors. > This would be great! > Any chance your patches will make it into 2.2.19? They might if you can confirm that the latest 2.2.19-pre patch + the appended fix the ESTALE problems. (I hope there are no typos here. I'm preparing to fly over to the Connectathon tonight, so I haven't had time to run a test, but the conversion from 2.4.2 should be trivial...) Cheers, Trond diff -u --recursive --new-file linux-2.2.19-pre14/fs/nfs/inode.c linux-2.2.19-stale/fs/nfs/inode.c --- linux-2.2.19-pre14/fs/nfs/inode.c Thu Feb 22 20:47:54 2001 +++ linux-2.2.19-stale/fs/nfs/inode.c Thu Mar 1 15:06:52 2001 @@ -689,7 +689,7 @@ if ((fattr->mode & S_IFMT) != (inode->i_mode & S_IFMT)) return 1; - if (is_bad_inode(inode)) + if (is_bad_inode(inode) || NFS_STALE(inode)) return 1; /* Has the filehandle changed? If so is the old one stale? */ @@ -871,7 +871,9 @@ dfprintk(PAGECACHE, "NFS: revalidating (%x/%Ld)\n", inode->i_dev, (long long)NFS_FILEID(inode)); - if (!inode || is_bad_inode(inode) || NFS_STALE(inode)) + if (!inode || is_bad_inode(inode)) + return -ESTALE; + if (NFS_STALE(inode) && inode != inode->i_sb->s_root->d_inode) return -ESTALE; while (NFS_REVALIDATING(inode)) { @@ -889,7 +891,8 @@ inode->i_dev, (long long)NFS_FILEID(inode), status); if (status == -ESTALE) { NFS_FLAGS(inode) |= NFS_INO_STALE; - remove_inode_hash(inode); + if (inode != inode->i_sb->s_root->d_inode) + remove_inode_hash(inode); } goto out; } @@ -903,6 +906,7 @@ dfprintk(PAGECACHE, "NFS: (%x/%Ld) revalidation complete\n", inode->i_dev, (long long)NFS_FILEID(inode)); + NFS_FLAGS(inode) &= ~NFS_INO_STALE; out: NFS_FLAGS(inode) &= ~NFS_INO_REVALIDATING; wake_up(&inode->i_wait);