Hello,
[ please CC: me, I'm not on the list ]
I'm currently in process of trying out a patch for smbfs, which
should among other things support file locking. The trouble is,
it is unusable in dosemu, because dosemu gets SIGALRM all the time
and smbfs file access operations are interruptible, thus all
the redirector in most cases doesn't get the data it asked for.

I was testing the smbfs on loopback only, but I can easily imagine
that dosemu may livelock:
1.dos_read () calls read () on a networked filesystem
2.the filesystem sends a request
3.signal arrives
4.filesystem aborts request due to signal
5.signal is handled
6.read () is restarted, go to 2. ... ad infinitum

The only real fix is to disable signals while operating on such
filesystems. The attached patch does this, but it seems to me
a brute-force solution. Isn't there a better way to do that?
[ BTW, should the patch be sent somewhere for inclusion? ]
        Mirek

diff -urN /usr/src/redhat/BUILD/dosemu-1.0.1/src/dosext/mfs/mfs.c 
dosemu_my/src/dosext/mfs/mfs.c
--- /usr/src/redhat/BUILD/dosemu-1.0.1/src/dosext/mfs/mfs.c     Sun Mar  5 13:57:37 
2000
+++ dosemu_my/src/dosext/mfs/mfs.c      Fri Feb  8 19:50:28 2002
@@ -800,6 +800,7 @@
   PRIV_SAVE_AREA
   int dos_fs_redirect();
   int ret;
+  sigset_t blockset, oldset;
 
   PS(MFS);
   if (!enter_priv_off()) {
@@ -807,7 +808,10 @@
     return 0;
   }
 
+  sigfillset (&blockset);
+  sigprocmask(SIG_SETMASK, &blockset, &oldset);
   ret = dos_fs_redirect(&REGS);
+  sigprocmask(SIG_SETMASK, &oldset, NULL);
   leave_priv_setting();
   PE(MFS);
 
@@ -837,12 +841,16 @@
   PRIV_SAVE_AREA
   boolean_t dos_fs_dev();
   boolean_t result;
+  sigset_t blockset, oldset;
 
   if (!enter_priv_off()) {
     leave_priv_setting();
     return 0;
   }
+  sigfillset (&blockset);
+  sigprocmask(SIG_SETMASK, &blockset, &oldset);
   result = dos_fs_dev(&REGS);
+  sigprocmask(SIG_SETMASK, &oldset, NULL);
   leave_priv_setting();
   return (result);
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to