xfs
[Top] [All Lists]

Re: XFS write cache flush policy

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: XFS write cache flush policy
From: Matthias Schniedermeyer <ms@xxxxxxx>
Date: Sun, 16 Dec 2012 12:10:46 +0100
Cc: Lin Li <sdeber@xxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20121216103025.GA14880@xxxxxxx>
References: <CAA_rkDfFUmZzT_kMznsTSNVxdfqfmz=bmJ400wdBOzocgP32eA@xxxxxxxxxxxxxx> <20121208192927.GA17875@xxxxxxx> <20121210005820.GG15784@dastard> <20121210091239.GA21114@xxxxxxx> <50C64C17.9080206@xxxxxxxxxxx> <20121214111924.GA4762@xxxxxxx> <20121215221622.GF9806@dastard> <20121216103025.GA14880@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On 16.12.2012 11:30, Matthias Schniedermeyer wrote:
> On 16.12.2012 09:16, Dave Chinner wrote:
> > 
> > Like most amateurs you've jump to the obvious conclusion without
> > considering all the other possibilities that could give the same
> > result.
> 
> I have a test-case, so you can cut out the amateur.
> Partition is 100GB at the beginning of a 1,5TB SATA HDD connected by 
> USB3 enclosure:
> Machine has 4GB of memory and is running a vanilla 3.7.0 kernel.
> 
> mkfs.xfs -l size=1024b -s size=4096 /dev/sdb1
> mount /dev/sdb1 /mnt
> mkdir /mnt/a
> cd /mnt/a
> for dat in `seq 1 40`; do dd if=/dev/zero of=$dat bs=1k count=900k ; done
> 
> Then i started a timer and waited for 5 minutes.
> Then i yanked out the cable, my machine was writing to the 24th file at 
> that point.
> 
> umount /mnt
> <replug cable>
> mount /dev/sdb1 /mnt
> ls -l /mnt
> <In words: Nothing there, not even a>
> 
> I tried it 3 times, all times with the same result that not even "a" was 
> there.
> 
> In the last run i did a `ls -l /mnt/a` at the 4 minute-point, it showed 
> several files with 900MB.

And boy is it unsafe to use XFS currently.

Modifed test-case. Same as above, except for this loop:
for dat in `seq 1 10`; do dd if=/dev/zero of=$dat bs=1k count=900k ; done
After it ran through i waited 5 minutes, IOW there were 5 minutes of 
nothing going on.
Yank out cable, yada, yada, yada.

Result: Same as above.

This proves(at last for the amateuer in me) that it is the same bug as 
the OP had.


Variant 3.
Same as 2, but with a 'sync' after the for-loop.
After 'sync' returns, i immediatly yank out the cable.
After replugging the result is as expect, the directroy and all files 
exist.


So as far as i can tell, currently there is a 'sync' missing somewhere.
It it is at least in kernels 3.6 & 3.7, maybe 3.5.
Could it be the removal of pdflush?



-- 

Matthias

<Prev in Thread] Current Thread [Next in Thread>