� ���, 02.07.2002, � 04:43, Salane �������:
> It looks like you need to
>
> On Thursday 27 June 2002 01:33 am, Borsenkow Andrej wrote:
> > > cd /mnt/cdrom2
> > > [root@dhcp-342-187 cdrom2]# ls
> > > ls: .: Stale NFS file handle
> >
> > Fix has been sent to Juan. It is one line change. If anybody is
> > interested I can post patch here.
>
Two patches attached. The small one (supermount.2.4.18-18mdk.ls.patch)
fixes the stale NFS handle problem (and as side effect some more
problems). It can be used on 8.2 without any problems.
The second patch is more intrusive. It fixes another media revalidation
problem reported here. When something accessed device after media had
been changed but before supermount did (a reported example was -
manually close tray and issue eject -t after that) media changed flag
was lost and supermount did not remount media. Beware, this patch
results in incompatible module versions.
BTW I have been running for some time with these patches and read-write
supermounted Jaz drive without any problems so far. There are other
problems with SCSI removables but they are unrelated to supermount.
-andrej
--- ./linux-2.4.18-18mdk/fs/supermount/super.c.supermount Sat Jun 8 10:10:21
2002
+++ ./linux-2.4.18-18mdk/fs/supermount/super.c Sat Jun 8 10:19:16 2002
@@ -171,6 +171,7 @@
{
struct supermount_sb_info *sbi = supermount_sbi(sb);
kdev_t dev;
+ struct super_block *subsb;
dump_sbi(sbi);
@@ -178,8 +179,9 @@
return 1;
/* check for disk change or disk not present */
- dev = supermount_subfs_sb(sbi)->s_dev;
- if (!just_check_disk_change(dev))
+ subsb = supermount_subfs_sb(sbi);
+ dev = subsb->s_dev;
+ if (!(subsb->s_media_changed || just_check_disk_change(dev)))
return 0;
/* We have a disk change! Unmount the subfs */
--- ./linux-2.4.18-18mdk/fs/inode.c.supermount Thu May 30 16:23:05 2002
+++ ./linux-2.4.18-18mdk/fs/inode.c Sat Jun 8 10:09:41 2002
@@ -653,7 +653,11 @@
{
struct super_block *sb = get_super(dev);
int res = 0;
+
if (sb) {
+#if defined(CONFIG_SUPERMOUNT) || defined(CONFIG_SUPERMOUNT_MODULE)
+ sb->s_media_changed = 1;
+#endif
res = invalidate_inodes(sb);
drop_super(sb);
}
--- ./linux-2.4.18-18mdk/include/linux/fs.h.supermount Sun Jun 2 22:13:57 2002
+++ ./linux-2.4.18-18mdk/include/linux/fs.h Sat Jun 8 23:37:37 2002
@@ -848,6 +848,15 @@
* non-directories) are allowed, but not unconnected diretories.
*/
struct semaphore s_nfsd_free_path_sem;
+#if defined(CONFIG_SUPERMOUNT) || defined(CONFIG_SUPERMOUNT_MODULE)
+ /*
+ * This one is for supermount. When somebody tries to access changed
+ * media before supermount, media changed flag is lost (the most natural
+ * example is eject -t). So we record this flag here. This flag is
+ * implicitly reset when superblock is destroyed
+ */
+ int s_media_changed;
+#endif
};
/*
--- linux-2.4.18-18mdk/fs/supermount/dentry_operations.orig Thu May 30 16:23:05
2002
+++ linux-2.4.18-18mdk/fs/supermount/dentry_operations.c Sun Jun 2 22:46:44
+2002
@@ -23,7 +23,7 @@
dump_dentry(dentry);
- if (!subfs_go_online(dentry->d_sb))
+ if (subfs_go_online(dentry->d_sb))
goto bad_dentry;
spin_lock(&dcache_lock);
if (dentry->d_inode && is_inode_obsolete(dentry->d_inode)) {