From: One day when we were young (cp76@solar.csie.ntu.edu.tw)
Date: 05/17/93


From: cp76@solar.csie.ntu.edu.tw (One day when we were young)
Subject: Re: No sync in linux DOS file system ??
Date: Tue, 18 May 1993 04:58:18 GMT

Stephen Tweedie (sct@dcs.ed.ac.uk) wrote:

: On 16 May 93 05:58:55 GMT, dhliu@solar.csie.ntu.edu.tw (Der-Hua Liu) said:

: > If you have tried dosemu, you will find this problem. If you copy some files
: > to a dos file system, use the sync command and copy and bring the dosemu up,
: > you will find the files is not in the dos drive.

: Are you trying to access a single partition simultaneously through the
: dos emulator and a mounted msdos filesystem? This is dangerous in a
: *BIG* way! The trouble is that if you have, say, /dev/hda1 mounted in
: the Linux directory tree as an msdos partition, the dos emulator
: itself will use /dev/hda (ie. the image of the _entire_ hard disk) to
: access it, rather than /dev/hda1 (the image of the single partition).

: Anyway, to cut a long story short, this means that the same physical
: disk blocks will be being accessed through two entirely different
: logical devices, and there is absolutely no coordination between them.
: You can seriously corrupt your filesystem doing this.

: *NEVER* run dosemu-0.48 or older on a mounted msdos partition, unless
: you use the dos redirector to access it through the linux filesystem
: code.

: Dosemu-0.49 will not have this problem - you will be able to mount a
: single partition as a dos disk. However, it will still be dangerous,
: since DOS does its own limited caching of disk blocks (the "BUFFERS"
: command in the config.sys sets this up), and there is no interaction
: between this cache and Linux's internal cache.
..........

That's not the answer of my problem. Let me describe my problem step by step.

0. Kill any memory-hungry process (eg. xv). The problem occurs on both PCs
with 8 & 16 mega RAM. 4 mega PC may not have this problem since the file
cache is small.
1. copy a small file to the dos file system.
2. sync and umount the dos file system
3. Run the dosemu. You will not see the file you copied under dosemu.
4. Mount the dos file system again. You will find that the file is indeed
   in the dos file system.

The problem is: Why ? Doesn't dosemu read device block directly ?

Edward Der-Hua Liu
dhliu@solar.csie.ntu.edu.tw