Skip to contentSkip to conversation

FS Development (or interrupting ls)

PATCH New Amit S. Kale 5 participants 6 messages Aug 3, 2001 1 message not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Tigran Aivazian had a patch for doing a forced unmount. It will solve your problem.
You can check whether he has a patch for the kernel you are using.

Quoted 26 lines · Sujal Shah

I'm working on a userspace filesystem daemon which replaces Venus (from CODA) or podfuk (UserVFS) using the CODA driver. I'm still early in my development process, but I've run into one frustrating problem. While testing my code, I have started causing ls to hang.

It keeps the directory open, which means I can't do things like, oh, unmount the filesystem. :-) Anyone have any suggestions on recovering gracefully when this happens short of rebooting (which is what I do now)? Basically, 'ls' hangs, and can't be killed (even kill -9) and 'lsof' lists the directory as open (which is furthered confirmed by umount complaining about the filesystem being busy).

Thanks,

Sujal

--
------ Sujal Shah ---- [email protected]

           http://www.sujal.net/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
Amit Kale
Veritas Software ( http://www.veritas.com )
#2 lore raw

PATCH 1/1 (was Re: FS Development (or interrupting ls)

Quoted 5 lines · Amit S. Kale

Tigran Aivazian had a patch for doing a forced unmount. It will solve your problem.
You can check whether he has a patch for the kernel you are using.

here it is:

fs/Makefile +1 -0
diff -urN -X dontdiff linux/fs/Makefile linux-2.4.7-vmfs/fs/Makefile
@@ -62,6 +62,7 @@
 subdir-$(CONFIG_REISERFS_FS)	+= reiserfs
 subdir-$(CONFIG_DEVPTS_FS)	+= devpts
 subdir-$(CONFIG_SUN_OPENPROMFS)	+= openpromfs
+subdir-y			+= badfs
 
 
 obj-$(CONFIG_BINFMT_AOUT)	+= binfmt_aout.o
fs/badfs/Makefile +8 -0
diff -urN -X dontdiff linux/fs/badfs/Makefile linux-2.4.7-vmfs/fs/badfs/Makefile
@@ -0,0 +1,8 @@
+#
+# Makefile for badfs filesystem.
+#
+
+O_TARGET := badfs.o
+obj-y   := inode.o
+
+include $(TOPDIR)/Rules.make
fs/badfs/inode.c +274 -0

274 lines not on this page · raw message

fs/super.c +3 -0
diff -urN -X dontdiff linux/fs/super.c linux-2.4.7-vmfs/fs/super.c
@@ -1090,6 +1109,9 @@
 		return retval;
 	}
 
+	if (flags&MNT_FORCE)
+		quiesce_filesystem(mnt);
+
 	spin_lock(&dcache_lock);
 
 	if (mnt->mnt_instances.next != mnt->mnt_instances.prev) {
include/linux/fs.h +2 -0
diff -urN -X dontdiff linux/include/linux/fs.h linux-2.4.7-vmfs/include/linux/fs.h
@@ -1372,6 +1374,8 @@
 extern kdev_t ROOT_DEV;
 extern char root_device_name[];
 
+/* fs/badfs/inode.c - used by forced umount */
+extern void quiesce_filesystem(struct vfsmount *);
 
 extern void show_buffers(void);
 extern void mount_root(void);
#3 lore raw
In reply to a message not in the archive
Quoted 6 lines · Sujal Shah

I'm working on a userspace filesystem daemon which replaces Venus (from CODA) or podfuk (UserVFS) using the CODA driver. I'm still early in my development process, but I've run into one frustrating problem. While testing my code, I have started causing ls to hang.

Quoted 6 lines

It keeps the directory open, which means I can't do things like, oh, unmount the filesystem. :-) Anyone have any suggestions on recovering gracefully when this happens short of rebooting (which is what I do now)? Basically, 'ls' hangs, and can't be killed (even kill -9) and 'lsof' lists the directory as open (which is furthered confirmed by umount complaining about the filesystem being busy).

Kill the userspace daemon, when the /dev/cfs0 device is closed all pending upcalls are aborted and further accesses to /coda will return EIO or something.

You still won't be able to unmount until all processes that have a reference to a file in /coda, typically caused by their 'cwd', i.e. use cd to move shell's out of the /coda tree and kill off any applications that were started from a shell that was at the time in /coda.

It is unusual that you are unable to kill ls, all upcalls to the userspace process should be interruptable (except for close). There might be something wrong in the way you created your directory container files and the kernel gets stuck in readdir, but strace or enabling verbose debugging from the kernel module should help you narrow it down. (echo 1 > /proc/sys/coda/printentry ; echo 4095 > /proc/sys/coda/debug)

Jan

#4 lore raw
In reply to a message not in the archive
Quoted 3 lines · Amit S. Kale

Tigran Aivazian had a patch for doing a forced unmount. It will solve your problem. You can check whether he has a patch for the kernel you are using.

And please post that patch to the list when you find it, or the URL :-)

--
Daniel

Quoted 12 lines
Quoted 11 lines · Sujal Shah

I'm working on a userspace filesystem daemon which replaces Venus (from CODA) or podfuk (UserVFS) using the CODA driver. I'm still early in my development process, but I've run into one frustrating problem. While testing my code, I have started causing ls to hang.

It keeps the directory open, which means I can't do things like, oh, unmount the filesystem. :-) Anyone have any suggestions on recovering gracefully when this happens short of rebooting (which is what I do now)? Basically, 'ls' hangs, and can't be killed (even kill -9) and 'lsof' lists the directory as open (which is furthered confirmed by umount complaining about the filesystem being busy).

#5 lore raw
Quoted 7 lines · Daniel Phillips
Quoted 3 lines · Amit S. Kale

Tigran Aivazian had a patch for doing a forced unmount. It will solve your problem. You can check whether he has a patch for the kernel you are using.

And please post that patch to the list when you find it, or the URL :-)

I have posted the patch, now am posting the URL ;)

http://www.moses.uklinux.net/patches/badfs.patch

Besides, I am only "one email hop" away, if anyone asks -- the same receives.

regards,
Tigran

#6 lore raw
In reply to a message not in the archive
Quoted 8 lines · Daniel Phillips
Quoted 4 lines · Amit S. Kale

Tigran Aivazian had a patch for doing a forced unmount. It will solve your problem. You can check whether he has a patch for the kernel you are using.

And please post that patch to the list when you find it, or the URL :-)

http://www.uwsg.indiana.edu/hypermail/linux/kernel/0007.2/0309.html

The attached thread contains some improvements... this was a quick search, BTW, and there may be a later version I'm just not aware of.

I'm actually going to take someone elses suggestion to use user mode linux, FYI (http://user-mode-linux.sf.net). That or, since Sourceforge seems unresponsive, I have VMWare somewhere....

Sujal