04 Jan, 2019

1 commit

  • The FAT16/12 has rootdir area before data area, and the clusters for
    rootdir are not mantained by FAT table. So we don't need to find empty
    cluster for next rootdir space, just use next dir cluster. And the FAT
    table don't need to update for this new dir cluster.

    Signed-off-by: Ye Li
    Acked-by: Peng Fan

    Ye Li
     

15 Dec, 2018

1 commit

  • Error: Invalid FAT entry: 0x3ffffffa
    create file

    when Long file name cross root dir cluster boundry, this issue
    happen.

    get_long_file_name have not consider fat12/16 case, which rootdir
    locate before data area. and try to get next clust directly. Only
    FAT32's root dir is located in data area

    Signed-off-by: Frank Li

    Frank Li
     

10 Mar, 2018

2 commits


30 Jan, 2018

1 commit


29 Jan, 2018

1 commit

  • Loading files stored with lzo compression from a btrfs filesystem was
    producing unaligned memory accesses, which were causing a data abort
    and a reset on an Orange Pi Zero.

    The change in hash.c is not triggered by any error but follows the
    same pattern. Please confirm.

    Fixed according to doc/README.unaligned-memory-access.txt

    Signed-off-by: Alberto Sánchez Molero
    Tested-by: Robert Nelson

    Alberto Sánchez Molero
     

23 Jan, 2018

3 commits


20 Jan, 2018

2 commits


10 Jan, 2018

1 commit


04 Dec, 2017

1 commit

  • This header was renamed to rawnand.h in Linux.

    The following is the corresponding commit in Linux.

    commit d4092d76a4a4e57b65910899948a83cc8646c5a5
    Author: Boris Brezillon
    Date: Fri Aug 4 17:29:10 2017 +0200

    mtd: nand: Rename nand.h into rawnand.h

    We are planning to share more code between different NAND based
    devices (SPI NAND, OneNAND and raw NANDs), but before doing that
    we need to move the existing include/linux/mtd/nand.h file into
    include/linux/mtd/rawnand.h so we can later create a nand.h header
    containing all common structure and function prototypes.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

30 Nov, 2017

2 commits

  • Before this patch one could receive following errors when executing "fatls"
    command on machine with cache enabled (ex i.MX6Q) :

    => fatls mmc 0:1
    CACHE: Misaligned operation at range [4f59dfc8, 4f59e7c8]
    CACHE: Misaligned operation at range [4f59dfc8, 4f59e7c8]
    ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4f59dfc8
    ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4f59e7c8
    CACHE: Misaligned operation at range [4f59dfc8, 4f59e7c8]
    CACHE: Misaligned operation at range [4f59dfc8, 4f59e7c8]
    ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4f59dfc8
    ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4f59e7c8

    To alleviate this problem - the calloc()s have been replaced with
    malloc_cache_aligned() and memset().

    After those changes the buffers are properly aligned (with both start
    address and size) to SoC cache line.

    Fixes: 09fa964bba80 ("fs/fat: Fix 'CACHE: Misaligned operation at range' warnings")
    Suggested-by: Lukasz Majewski
    Signed-off-by: Neil Armstrong
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Fabio Estevam

    Neil Armstrong
     
  • It is unwise to first dereference a variable
    and then to check if it was NULL.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Marek Behun
    Reviewed-by: Bin Meng

    Heinrich Schuchardt
     

27 Nov, 2017

1 commit


21 Nov, 2017

1 commit


20 Nov, 2017

2 commits


24 Oct, 2017

1 commit

  • All users of this macro have been converted. Remove MTDDEBUG and
    related CONFIG options.

    ubifs_dbg_msg_key() is kept. It is silent unless DEBUG is defined.

    I am not touching scripts/config_whitelist.txt. The deprecated options
    will be dropped by the next resync.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

16 Oct, 2017

5 commits

  • This makes gcc no longer expect an out-of-line version of the
    functions being present elsewhere.

    This fixes a failure to build on several marvell targets with gcc-7 on
    Debian:

    https://bugs.debian.org/877963

    Signed-off-by: Adrian Bunk
    Signed-off-by: Vagrant Cascadian

    Vagrant Cascadian
     
  • Hello,

    I ran into a problem with the JFFS2 filesystem driver implemented in U-Boot.

    I've got a NAND device that has correctable ECC errors (corrected somewhere in mtd/nand/nand_base.c).
    The NAND driver tells the filesystem layer (jffs2_1pass.c) above that there occurred correctable ECC errors and returns with a "value > 0".
    The JFFS2 driver recognizes the corrected ECC errors as real error and skips this block because the only accepts a "return value == 0" as correct.

    This problem exists for over 8 years (I checked version 2010.09) so I'm a little bit worried that I interpreted something wrong or didn't get the whole context.

    Can someone confirm this bug (and the bugfix) in the u-boot jffs2 driver?

    There was a mail in 2012 that mentioned the same problem, but there was no patch:
    http://u-boot.10912.n7.nabble.com/JFFS2-seems-to-drop-nand-data-with-ECC-corrections-td142008.html
    Sometime after this discussion the return value of nand_read() changed from -EUCLEAN as correctable ECC error to a positive value with the count of ECC corrected errors.

    With kind reguards,
    Uwe Engling

    Engling, Uwe
     
  • Otherwise fs_opendir will fault.

    Signed-off-by: Marek Behun

    Marek Behún
     
  • I accidentaly left a foreign language note in the code from development.

    Signed-off-by: Marek Behun

    Marek Behún
     
  • The variable res should be initialized to 0 in these functions,
    because if the searched key is not found, the variable is used
    uninitialized.

    Reported-by: Coverity (CID: 167335)
    Reported-by: Coverity (CID: 167336)
    Reported-by: Coverity (CID: 167337)
    Signed-off-by: Marek Behun

    Marek Behún
     

09 Oct, 2017

2 commits

  • Check malloc() return values and properly unwind on errors so
    memory allocated for fat_itr structures get freed properly.

    Also fixes a leak of fsdata.fatbuf in fat_size().

    Fixes: 2460098cffacd1 ("fs/fat: Reduce stack usage")
    Reported-by: Coverity (CID: 167225, 167233, 167234)
    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Tom Rini

    Tuomas Tynkkynen
     
  • The 'block' field of fat_itr needs to be properly aligned for DMA and
    while it does have '__aligned(ARCH_DMA_MINALIGN)', the fat_itr structure
    itself needs to be properly aligned as well.

    While at it use malloc_cache_aligned() for the other aligned allocations
    in the file as well.

    Fixes: 2460098cffacd1 ("fs/fat: Reduce stack usage")
    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Tom Rini

    Tuomas Tynkkynen
     

06 Oct, 2017

3 commits

  • As reported by Coverity, we did not free dirnode in the case of failure.
    Do so now.

    Reported-by: Coverity (CID: 131221)
    Cc: Stefan Brüns
    Signed-off-by: Tom Rini

    Tom Rini
     
  • If we end up back in the root directory via a '..' directory entry, set
    itr->is_root accordingly. Failing to do that gives spews like
    "Invalid FAT entry" and being unable to access directory entries located
    past the first cluster of the root directory.

    Fixes: 8eafae209c35 ("fat/fs: convert to directory iterators")
    Reviewed-by: Tom Rini
    Signed-off-by: Tuomas Tynkkynen

    Tuomas Tynkkynen
     
  • The current code doesn't compute the group descriptor checksum correctly
    for the filesystems that e2fsprogs 1.43.4 creates (they have
    'Group descriptor size: 64' as reported by tune2fs). Extend the checksum
    calculation to be done as ext4_group_desc_csum() does in Linux.

    This fixes these errors in dmesg from running fs-test.sh and makes it
    succeed again:

    [1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965)
    [1671902.620706] EXT4-fs (loop1): group descriptors corrupted!

    Signed-off-by: Tuomas Tynkkynen

    Tuomas Tynkkynen
     

04 Oct, 2017

1 commit

  • U-Boot widely uses error() as a bit noisier variant of printf().

    This macro causes name conflict with the following line in
    include/linux/compiler-gcc.h:

    # define __compiletime_error(message) __attribute__((error(message)))

    This prevents us from using __compiletime_error(), and makes it
    difficult to fully sync BUILD_BUG macros with Linux. (Notice
    Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

    Let's convert error() into now treewide-available pr_err().

    Done with the help of Coccinelle, excluing tools/ directory.

    The semantic patch I used is as follows:

    //
    @@@@
    -error
    +pr_err
    (...)
    //

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass
    [trini: Re-run Coccinelle]
    Signed-off-by: Tom Rini

    Masahiro Yamada
     

03 Oct, 2017

6 commits

  • We specifically say that the last arg is u32, so use %lu.

    Signed-off-by: Tom Rini

    Tom Rini
     
  • Signed-off-by: Marek Behun

    create mode 100644 fs/btrfs/Kconfig
    create mode 100644 fs/btrfs/Makefile
    create mode 100644 fs/btrfs/btrfs.c
    create mode 100644 include/btrfs.h

    Marek Behún
     
  • This adds the proper implementation for the BTRFS filesystem.
    The implementation currently supports only read-only mode and
    the filesystem can be only on a single device.

    Checksums of data chunks is unimplemented.

    Compression is implemented (ZLIB + LZO).

    Signed-off-by: Marek Behun

    create mode 100644 fs/btrfs/btrfs.h
    create mode 100644 fs/btrfs/chunk-map.c
    create mode 100644 fs/btrfs/compression.c
    create mode 100644 fs/btrfs/ctree.c
    create mode 100644 fs/btrfs/dev.c
    create mode 100644 fs/btrfs/dir-item.c
    create mode 100644 fs/btrfs/extent-io.c
    create mode 100644 fs/btrfs/hash.c
    create mode 100644 fs/btrfs/inode.c
    create mode 100644 fs/btrfs/root.c
    create mode 100644 fs/btrfs/subvolume.c
    create mode 100644 fs/btrfs/super.c

    Marek Behún
     
  • BTRFS on disk structures are stored in Little Endian. Add functions
    to convert this structures to cpu and to disk format.

    On Little Endian hosts, these functions do nothing.

    On Big Endian the CALL_MACRO_FROM_EACH from variadic-macro.h is used
    to define all the members for each structure on which cpu_to_le* or
    le*_to_cpu is to be called.

    Signed-off-by: Marek Behun

    create mode 100644 fs/btrfs/conv-funcs.h

    Marek Behún
     
  • Add btrfs_tree.h and ctree.h from Linux which contains constants
    and structures for the BTRFS filesystem.

    Signed-off-by: Marek Behun

    create mode 100644 fs/btrfs/btrfs_tree.h
    create mode 100644 fs/btrfs/ctree.h

    Marek Behún
     
  • The ext4, reiserfs and zfs filesystems all have their own implementation
    of the same function, *_devread. Generalize this function into fs_devread
    and put the code into fs/fs_internal.c.

    Signed-off-by: Marek Behun
    [trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all
    cases need it]
    Signed-off-by: Tom Rini

    Marek Behún
     

22 Sep, 2017

1 commit

  • We have limited stack in SPL builds. Drop itrblock and move to
    malloc/free of itr to move this off of the stack. As part of this fix a
    double-free issue in fat_size().

    Signed-off-by: Tom Rini
    ---
    Rework to use malloc/free as moving this to a global overflows some SH
    targets.

    Tom Rini
     

15 Sep, 2017

2 commits

  • A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),
    but not freed, resulting in eventually running out of memory. Spotted
    by running 'ls -r' in a large FAT filesystem from Shell.efi.

    fatbuf is mainly used to cache FAT entry lookups (get_fatent())..
    possibly once fat_write.c it can move into the iterator to simplify
    this.

    Signed-off-by: Rob Clark
    Reviewed-by: Simon Glass
    Reviewed-by: Łukasz Majewski

    Rob Clark
     
  • Use the clust_to_sect() helper that was introduced earlier, and add an
    inverse sect_to_clust(), plus update the various spots that open-coded
    this conversion previously.

    Signed-off-by: Rob Clark
    Reviewed-by: Simon Glass

    Rob Clark