diff -ur linux-2.4.9-PRISTINE/fs/Makefile linux-my/fs/Makefile
--- linux-2.4.9-PRISTINE/fs/Makefile	Fri Aug 24 20:13:42 2001
+++ linux-my/fs/Makefile	Tue Aug 28 18:59:20 2001
@@ -32,6 +32,7 @@
 subdir-$(CONFIG_CODA_FS)	+= coda
 subdir-$(CONFIG_MINIX_FS)	+= minix
 subdir-$(CONFIG_FAT_FS)		+= fat
+subdir-$(CONFIG_UMSDOS_FS)	+= umsdos
 subdir-$(CONFIG_MSDOS_FS)	+= msdos
 subdir-$(CONFIG_VFAT_FS)	+= vfat
 subdir-$(CONFIG_BFS_FS)		+= bfs
@@ -43,7 +44,6 @@
 subdir-$(CONFIG_NFSD)		+= nfsd
 subdir-$(CONFIG_LOCKD)		+= lockd
 subdir-$(CONFIG_NLS)		+= nls
-subdir-$(CONFIG_UMSDOS_FS)	+= umsdos
 subdir-$(CONFIG_SYSV_FS)	+= sysv
 subdir-$(CONFIG_SMB_FS)		+= smbfs
 subdir-$(CONFIG_NCP_FS)		+= ncpfs
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/README-WIP.txt linux-my/fs/umsdos/README-WIP.txt
--- linux-2.4.9-PRISTINE/fs/umsdos/README-WIP.txt	Thu Dec  9 22:22:21 1999
+++ linux-my/fs/umsdos/README-WIP.txt	Mon Aug 27 12:43:55 2001
@@ -5,15 +5,11 @@
 There is no warning any more.
 Both read-only and read-write stuff is fixed, both in
 msdos-compatibile mode, and in umsdos EMD mode, and it seems stable.
-There are still few hardlink nuisances, but those are not fatal.
-
-I'd call it pre-release, and ask for as many people as possible to
-come and test it! See notes below for some more information, or if
-you are trying to use UMSDOS as root partition.
 
 Userland NOTE: new umsdos_progs (umssync, umssetup, udosctl & friends) that
-will compile and work on 2.2.x kernels and glibc based systems may be found
-at http://cvs.linux.hr/
+will compile and work on 2.2.x+ kernels and glibc based systems, as well as
+kernel patches and other umsdos related information may be found at
+http://linux.voyager.hr/umsdos/
 
 Also look at the quick-hack "homepage" for umsdos filesystem at 
 http://www.voyager.hr/~mnalis/umsdos
@@ -24,7 +20,7 @@
 Legend: those lines marked with '+' on the beggining of line indicates it
 passed all of my tests, and performed perfect in all of them.
 
-Current status (990202) - UMSDOS 0.85:
+Current status (010125) - UMSDOS 0.86j:
 
 (1) pure MSDOS (no --linux-.--- EMD file):
 
@@ -130,6 +126,4 @@
 I'm unfortunately somewhat out of time to read linux-kernel@vger, but I do
 check for messages having "UMSDOS" in the subject, and read them.  I might
 miss some in all that volume, though.  I should reply to any direct e-mail
-in few days.  If I don't, probably I never got your message.  You can try
-mnalis-umsdos@voyager.hr; however mnalis@jagor.srce.hr is preferable.
-
+in few days.  If I don't, probably I never got your message.
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/dir.c linux-my/fs/umsdos/dir.c
--- linux-2.4.9-PRISTINE/fs/umsdos/dir.c	Fri Feb  9 20:29:44 2001
+++ linux-my/fs/umsdos/dir.c	Mon Aug 27 20:40:04 2001
@@ -67,7 +67,7 @@
 static int umsdos_dir_once (	void *buf,
 				const char *name,
 				int len,
-				off_t offset,
+				loff_t offset,
 				ino_t ino,
 				unsigned type)
 {
@@ -215,6 +215,8 @@
 		/* check whether to resolve a hard-link */
 		if ((entry.flags & UMSDOS_HLINK) &&
 		    !inode->u.umsdos_i.i_is_hlink) {
+printk("/mn/ FIXME readdir_x resolving %s/%s\n", 	    
+dret->d_parent->d_name.name, dret->d_name.name);
 			dret = umsdos_solve_hlink (dret);
 			ret = PTR_ERR(dret);
 			if (IS_ERR(dret))
@@ -651,7 +653,7 @@
 	old_root = dget(current->fs->root);
 	read_unlock(&current->fs->lock);
 	spin_lock(&dcache_lock);
-	path = __d_path(dentry, NULL, dentry->d_sb->s_root, NULL, buffer, len);
+	path = __d_path(dentry, current->fs->rootmnt, dentry->d_sb->s_root, current->fs->rootmnt, buffer, len); /* FIXME: current->fs->rootmnt */
 	spin_unlock(&dcache_lock);
 
 	if (*path == '/')
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/emd.c linux-my/fs/umsdos/emd.c
--- linux-2.4.9-PRISTINE/fs/umsdos/emd.c	Wed Mar  7 04:44:37 2001
+++ linux-my/fs/umsdos/emd.c	Mon Aug 27 12:43:55 2001
@@ -18,7 +18,21 @@
 #include <linux/pagemap.h>
 #include <linux/delay.h>
 
-static void copy_entry(struct umsdos_dirent *p, struct umsdos_dirent *q)
+void put_entry (struct umsdos_dirent *p, struct umsdos_dirent *q)
+{
+	p->name_len = q->name_len;
+	p->flags = q->flags;
+	p->nlink = cpu_to_le16(q->nlink);
+	p->uid = cpu_to_le16(q->uid);
+	p->gid = cpu_to_le16(q->gid);
+	p->atime = cpu_to_le32(q->atime);
+	p->mtime = cpu_to_le32(q->mtime);
+	p->ctime = cpu_to_le32(q->ctime);
+	p->rdev = cpu_to_le16(q->rdev);
+	p->mode = cpu_to_le16(q->mode);
+}
+
+static void get_entry(struct umsdos_dirent *p, struct umsdos_dirent *q)
 {
 	p->name_len = q->name_len;
 	p->name[p->name_len]='\0';
@@ -136,6 +150,7 @@
 		printk (KERN_WARNING "Ignoring invalid EMD entry with size %d\n", entry->name_len);
 		p->name_len = 0; 
 		ret = -ENAMETOOLONG; /* notify umssync(8) code that something is wrong */
+		/* FIXME: does not work if we did 'ls -l' before 'udosctl uls' ?! */
 	}
 
 	recsize = umsdos_evalrecsize(p->name_len);
@@ -163,7 +178,7 @@
 		page_cache_release(page2);
 	} else
 		memcpy(entry->spare,p->spare,((char*)p+recsize)-p->spare);
-	copy_entry(entry, p);
+	get_entry(entry, p);
 	kunmap(page);
 	page_cache_release(page);
 	*pos += recsize;
@@ -249,20 +264,11 @@
 					offs+info->recsize-PAGE_CACHE_SIZE);
 		if (ret)
 			goto out_unlock3;
-		p->name_len = entry->name_len;
-		p->flags = entry->flags;
-		p->nlink = cpu_to_le16(entry->nlink);
-		p->uid = cpu_to_le16(entry->uid);
-		p->gid = cpu_to_le16(entry->gid);
-		p->atime = cpu_to_le32(entry->atime);
-		p->mtime = cpu_to_le32(entry->mtime);
-		p->ctime = cpu_to_le32(entry->ctime);
-		p->rdev = cpu_to_le16(entry->rdev);
-		p->mode = cpu_to_le16(entry->mode);
-		memcpy(p->name,entry->name,
+		put_entry (p, entry);
+		memcpy(p->spare,entry->spare,
 			(char *)(page_address(page) + PAGE_CACHE_SIZE) - p->spare);
 		memcpy(page_address(page2),
-				entry->spare+PAGE_CACHE_SIZE-offs,
+				((char*)entry)+PAGE_CACHE_SIZE-offs,
 				offs+info->recsize-PAGE_CACHE_SIZE);
 		ret = mapping->a_ops->commit_write(NULL,page2,0,
 					offs+info->recsize-PAGE_CACHE_SIZE);
@@ -279,16 +285,7 @@
 					offs + info->recsize);
 		if (ret)
 			goto out_unlock;
-		p->name_len = entry->name_len;
-		p->flags = entry->flags;
-		p->nlink = cpu_to_le16(entry->nlink);
-		p->uid = cpu_to_le16(entry->uid);
-		p->gid = cpu_to_le16(entry->gid);
-		p->atime = cpu_to_le32(entry->atime);
-		p->mtime = cpu_to_le32(entry->mtime);
-		p->ctime = cpu_to_le32(entry->ctime);
-		p->rdev = cpu_to_le16(entry->rdev);
-		p->mode = cpu_to_le16(entry->mode);
+		put_entry (p, entry);
 		memcpy(p->spare,entry->spare,((char*)p+info->recsize)-p->spare);
 		ret = mapping->a_ops->commit_write(NULL,page,offs,
 					offs + info->recsize);
@@ -463,7 +460,7 @@
 			goto skip_it;
 
 		info->f_pos = pos;
-		copy_entry(entry, rentry);
+		get_entry(entry, rentry);
 		ret = 0;
 		break;
 skip_it:
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/inode.c linux-my/fs/umsdos/inode.c
--- linux-2.4.9-PRISTINE/fs/umsdos/inode.c	Sun May 20 03:02:45 2001
+++ linux-my/fs/umsdos/inode.c	Tue Aug 28 18:58:20 2001
@@ -38,7 +38,7 @@
 		 ,atomic_read(&inode->i_count)));
 
 	if (inode == pseudo_root) {
-		printk (KERN_ERR "Umsdos: debug: releasing pseudo_root - ino=%lu count=%d\n", inode->i_ino, atomic_read(&inode->i_count));
+		Printk ((KERN_ERR "Umsdos: debug: releasing pseudo_root - ino=%lu count=%d\n", inode->i_ino, atomic_read(&inode->i_count)));
 	}
 
 	if (atomic_read(&inode->i_count) == 1)
@@ -49,7 +49,7 @@
 void UMSDOS_put_super (struct super_block *sb)
 {
 	Printk ((KERN_DEBUG "UMSDOS_put_super: entering\n"));
-	if (saved_root) {
+	if (saved_root && pseudo_root && sb->s_dev == ROOT_DEV) {
 		shrink_dcache_parent(saved_root);
 		dput(saved_root);
 		saved_root = NULL;
@@ -316,16 +316,16 @@
 	struct super_block *res;
 	struct dentry *new_root;
 
-	MSDOS_SB(sb)->options.isvfat = 0;
 	/*
 	 * Call msdos-fs to mount the disk.
 	 * Note: this returns res == sb or NULL
 	 */
 	res = msdos_read_super (sb, data, silent);
+
 	if (!res)
 		goto out_fail;
 
-	printk (KERN_INFO "UMSDOS 0.86i "
+	printk (KERN_INFO "UMSDOS 0.86j "
 		"(compatibility level %d.%d, fast msdos)\n", 
 		UMSDOS_VERSION, UMSDOS_RELEASE);
 
@@ -333,22 +333,31 @@
 	MSDOS_SB(sb)->options.dotsOK = 0;	/* disable hidden==dotfile */
 
 	/* install our dentry operations ... */
-	sb->s_root->d_op = &umsdos_dentry_operations;
+	sb->s_root->d_op = &umsdos_dentry_operations;	/* FIXME! what about msdos_dentry_operations ? */
+
 	umsdos_patch_dentry_inode(sb->s_root, 0);
 
+#if 1
+printk( "/mn/ check_pseudo_root?\n");
+
 	/* Check whether to change to the /linux root */
 	new_root = check_pseudo_root(sb);
+#else
+	new_root = NULL;
+#endif
+
+printk( "/mn/ is_new_root?\n"); 
 
 	if (new_root) {
+printk( "/mn/. OK. we have new_root\n");
 		/* sanity check */
 		if (new_root->d_op != &umsdos_dentry_operations)
 			printk("umsdos_read_super: pseudo-root wrong ops!\n");
 
 		pseudo_root = new_root->d_inode;
-
 		saved_root = sb->s_root;
-		sb->s_root = new_root;
 		printk(KERN_INFO "UMSDOS: changed to alternate root\n");
+		dget (sb->s_root); sb->s_root = dget(new_root);
 	}
 	return sb;
 
@@ -379,10 +388,14 @@
 	 */
 	printk(KERN_INFO "check_pseudo_root: mounted as root\n");
 	root = lookup_one_len(UMSDOS_PSDROOT_NAME, sb->s_root,UMSDOS_PSDROOT_LEN); 
+printk ("/mn/ after lookup_one\n");
 	if (IS_ERR(root))
 		goto out_noroot;
+		
+printk ("/mn/ Found c:\\linux\n");
 	if (!root->d_inode || !S_ISDIR(root->d_inode->i_mode))
 		goto out_dput;
+printk ("/mn/ c:\\linux has inode and is directory\n");		
 
 	printk(KERN_INFO "check_pseudo_root: found %s/%s\n", root->d_parent->d_name.name, root->d_name.name);
 
@@ -390,11 +403,14 @@
 	sbin = lookup_one_len("sbin", root, 4);
 	if (IS_ERR(sbin))
 		goto out_dput;
+printk ("/mn/ has /sbin\n");		
 	if (!sbin->d_inode || !S_ISDIR(sbin->d_inode->i_mode))
 		goto out_dput_sbin;
+printk ("/mn/ /sbin has inode\n");		
 	init = lookup_one_len("init", sbin, 4);
 	if (IS_ERR(init))
 		goto out_dput_sbin;
+printk ("/mn/ has /sbin/init\n");		
 	if (!init->d_inode)
 		goto out_dput_init;
 	printk(KERN_INFO "check_pseudo_root: found %s/%s, enabling pseudo-root\n", init->d_parent->d_name.name, init->d_name.name);
@@ -410,6 +426,7 @@
 out_dput:
 	dput(root);
 out_noroot:
+printk ("/mn/ out_noroot\n");
 	return NULL;
 }
 
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/ioctl.c linux-my/fs/umsdos/ioctl.c
--- linux-2.4.9-PRISTINE/fs/umsdos/ioctl.c	Wed Apr 18 20:49:13 2001
+++ linux-my/fs/umsdos/ioctl.c	Mon Aug 27 12:43:55 2001
@@ -28,7 +28,7 @@
 				     void *buf,
 				     const char *name,
 				     int name_len,
-				     off_t offset,
+				     loff_t offset,
 				     ino_t ino,
 				     unsigned type)
 {
diff -ur linux-2.4.9-PRISTINE/fs/umsdos/rdir.c linux-my/fs/umsdos/rdir.c
--- linux-2.4.9-PRISTINE/fs/umsdos/rdir.c	Fri Feb  9 20:29:44 2001
+++ linux-my/fs/umsdos/rdir.c	Mon Aug 27 12:43:56 2001
@@ -32,7 +32,7 @@
 static int rdir_filldir (	void *buf,
 				const char *name,
 				int name_len,
-				off_t offset,
+				loff_t offset,
 				ino_t ino,
 				unsigned int d_type)
 {

