All of lore.kernel.org
 help / color / mirror / Atom feed
From: col-pepper@piments.com
To: linux-kernel@vger.kernel.org
Subject: o_sync in vfat driver
Date: Mon, 27 Feb 2006 00:08:50 +0100	[thread overview]
Message-ID: <op.s5lrw0hrj68xd1@mail.piments.com> (raw)


*** Is that aim being achieved by the current policy? ***

As I understand it the old (<=2.6.11) sync model kept the data in sync
without updating the FAT until later. This runs the risks of partial
corruption of one or more files on pullout.

The new model attempts to be more rigourous by updating the FAT every time
a block of data is written. Thus the "hammering" of the physical memory
hosting the FAT record.

In view of the nature of flash memory this may actually be drastically
increasing the chance that the whole FAT gets erased.
part IV (end of a sage)

If a pullout occurs during write , there is now a near 50% chance that
this takes out the entire FAT.

It would seem that the main advantage of this scheme is that it is so slow
that it encourages users to turn it off. Presumably in the process of
coming to that conclusion they will become aware of the need to run umount
or the sync command before doing removing the device.

= Danger of destroying hardware =

It seems that there are well documented cases of this abusive rewriting of
the FAT causing rapid and total premature failure of what Alan Cox refers
to as "ultra-crap devices".

There may be valid reasons of cost or miniaturisation that preclude the
additional hardware found in more complex devices.

Even if better quality devices may have some sort of paging mechanism
which makes them more resistant to this sort of abuse, it does not seem
good engineering practice to dismiss those that fail as "shite".

There is nothing in the spec of vfat that suggests the FAT will be written
10.000 during the writing of one large file. Indeed it is hard to imagine
that any other implementation on any other OS or any previous linux kernel
behaves like that.

So should the hardware manufacturers have anticipated this particular
driver implementation or should the kernel be more aware of the existing
hardware that it purports to support.

= The way forward =

It would seem that the first step could be to revert to the 2.6.11
behaviour which was more appropriate and probably safer even from the data
point of view.

I lack the knowlege and experience to produce reliable kernel code so I
wont try. However, I have already seen a number of suggestions of how the
old model could be improved. This post could be the starting point for a
discussion of more robust techniques. In any case the coding is unlikely
to be very complex given the existing , tested code base that is in place
in 2.6.11

Any new technique should probably aim to be applicable to larger devices
as well. The 2G limit is artificial and is a tacit recognition of the
precarity of the current code. USB hard disks are just as prone to
accidental cable pullout. Some periodic or per file sync should probably
be envisaged for the VFAT sync mount option.


PS if anyone can tell me why I had to post this ten times and chop it into  
little bits it would be appreciated in not messing up the list in the  
future.

I spent an hour reading the faq and I dont see anything taboo here.


             reply	other threads:[~2006-02-26 23:08 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26 23:08 col-pepper [this message]
2006-02-27  0:51 ` o_sync in vfat driver Andrew Morton
2006-02-27 22:19   ` col-pepper
2006-02-27 23:12     ` Andrew Morton
2006-02-28 18:47       ` Chris Mason
2006-02-28 19:10         ` Andrew Morton
2006-02-28 19:48           ` Chris Mason
     [not found]         ` <87u0aiw6pi.fsf@duaron.myhome.or.jp>
2006-03-01 15:23           ` Chris Mason
     [not found]             ` <87mzg9wst0.fsf@duaron.myhome.or.jp>
2006-03-02 13:45               ` Chris Mason
2006-03-02 14:07                 ` OGAWA Hirofumi
2006-03-02 17:01                   ` Chris Mason
2006-03-02 18:14                     ` OGAWA Hirofumi
2006-03-29  2:13         ` Mathis Ahrens
2006-03-30 17:35           ` col-pepper
2006-02-28  0:52     ` Machida, Hiroyuki
  -- strict thread matches above, loose matches on Subject: below --
2006-02-26 22:55 col-pepper
     [not found] <op.s5cj47sxj68xd1@mail.piments.com>
     [not found] ` <op.s5jpqvwhui3qek@mail.piments.com>
     [not found]   ` <op.s5kxhyzgfx0war@mail.piments.com>
     [not found]     ` <op.s5kx7xhfj68xd1@mail.piments.com>
     [not found]       ` <op.s5kya3t0j68xd1@mail.piments.com>
     [not found]         ` <op.s5ky2dbcj68xd1@mail.piments.com>
     [not found]           ` <op.s5ky71nwj68xd1@mail.piments.com>
     [not found]             ` <op.s5kzao2jj68xd1@mail.piments.com>
2006-02-26 22:50               ` col-pepper
2006-02-27 13:28                 ` Lennart Sorensen
2006-02-27 13:50                   ` Arjan van de Ven
2006-02-27 14:06                     ` Anton Altaparmakov
2006-02-27 14:27                       ` Arjan van de Ven
2006-02-27 14:41                         ` Anton Altaparmakov
2006-02-27 21:04                           ` col-pepper
2006-02-27 21:17                             ` Arjan van de Ven
2006-02-27 23:21                               ` col-pepper
2006-02-27 21:32                             ` linux-os (Dick Johnson)
2006-02-27 23:21                               ` col-pepper
2006-02-28 13:10                                 ` linux-os (Dick Johnson)
2006-02-28 13:52                                   ` Sergei Organov
2006-02-28 15:18                                   ` Lennart Sorensen
2006-02-28 16:16                                     ` linux-os (Dick Johnson)
2006-02-28 17:23                                       ` Sergei Organov
2006-02-28 18:09                                       ` Krzysztof Halasa
2006-02-28 17:16                                   ` col-pepper
2006-02-28 22:38                                 ` Pavel Machek
2006-03-01  4:28                                   ` Kyle Moffett
2006-03-02  8:23                                   ` col-pepper
2006-03-02  8:32                                     ` Pavel Machek
2006-02-28 16:11                             ` Helge Hafting
2006-02-28 22:37                             ` Pavel Machek
2006-02-27 14:26                   ` linux-os (Dick Johnson)
2006-02-27 18:53                     ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.s5lrw0hrj68xd1@mail.piments.com \
    --to=col-pepper@piments.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.