Re: mmap returns incorrect data

From: Russell King (rmk+lkml_at_arm.linux.org.uk)
Date: 04/30/04

  • Next message: Sean Estabrooks: "Re: [PATCH] Blacklist binary-only modules lying about their license"
    Date:	Fri, 30 Apr 2004 00:47:05 +0100
    To: marcus hall <marcus@tuells.org>
    
    

    On Thu, Apr 29, 2004 at 05:12:43PM -0600, marcus hall wrote:
    > I have a system based on 2.5.59 kernel for arm. This system was previously
    > running OK with all filesystems on a stratoflash chip, but I have recently
    > moved the filesystems to a compact flash chip. Some filesystems are
    > cramfs, and some have changed from jffs2 to ext3 along with the move.

    You _really_ don't want to use ext3 on CF unless you want to wear the
    flash quickly. Just because a filesystem has journaling does _not_
    mean that its suitable for flash (in fact, it may be far worse for
    flash than its non-journaled counterpart, as in this case.)

    > I am having trouble with ldconfig not recognizing some files as being valid.
    > The files that cause the problem are files that are on an ext3 filesystem
    > on the CF. Other files on a cramfs filesystem seem to work reliably.
    > It seems that ldconfig mmap()s the file into its address space, and what
    > it sees doesn't match what is in the file. If I pre-read the file before
    > running ldconfig, so that the contents get into the cache, then ldconfig
    > proceeds normally.

    This is an IDE driver bug - it performs PIO but does not ensure that the
    individual pages are properly flushed to RAM before telling the kernel
    that the IO is complete. (If someone wants to disagree, look at how
    rd.c does flush_dcache_page, and see previous discussions on lkml
    concerning this.)

    -- 
    Russell King
     Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
     maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                     2.6 Serial core
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Sean Estabrooks: "Re: [PATCH] Blacklist binary-only modules lying about their license"

    Relevant Pages

    • Re: ext2/3: document conditions when reliable operation is possible
      ... When you say Linux filesystems do you mean "filesystems originally ... designed on Linux" or do you mean "filesystems that Linux supports"? ... the best filesystem for USB flash devices is probably UDF. ... If you yank a USB flash disk in the middle of a write, ...
      (Linux-Kernel)
    • Re: flashcopy
      ... Thanks for a valuable discussion on ESS flash copy feature! ... One question ...you said that unmounting source filesystems ... I have not seen any requirement of running fsck on target volumes ...
      (comp.unix.aix)
    • Re: [freebsd-current] re: fsck_4.2bsd: cannot alloc 4294967292 bytes for inoinfo
      ... filesystems on it I get a kernel panic ... and mounted it on the Soekris system, and as soon as I start to use ... This sounds very much like data corruption between the flash and the ... Try dd'ing off the first 1MB or so using valhalla and also using one ...
      (freebsd-current)
    • Re: partially encrypted filesystem
      ... >> Of course, all this is at the logical file level, and ignores the ... I am aware of how flash and log structured filesystems work. ... Maybe okay for a flash filesystem which is slow anyway, but many filesystem designers *are* concerned about physical locality of blocks, for example video filesystems. ...
      (Linux-Kernel)
    • Re: Fw: 2.6.23-rc3-mm1 UnionFS "BUG: atomic counter underflow"
      ... I compiled the kernel on an Ubuntu host. ... enabled multiprocessor or large memory support. ... # Firmware Drivers ...
      (Linux-Kernel)