30 Apr, 2008

1 commit


29 Apr, 2008

1 commit


28 Apr, 2008

10 commits

  • Annoying gcc warning:

    fs/fat/inode.c: In function 'fat_fill_super':
    fs/fat/inode.c:1222: warning: comparison is always false due to limited range of data type

    Change it to compare with 4K instead of PAGE_CACHE_SIZE, as suggested
    by OGAWA-san.

    [FAT spec says: logical_sector_size should be 512, 1024, 2048 4096]
    So, at least for now, we limit it to 4096.

    Signed-off-by: Olof Johansson
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • The on-disk media specification field in FAT is only 8-bits, so testing for

    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • __getname() is faster than __get_free_page(). Use it.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This patch fix the problem that the buffer allocated for convert of unicode to
    utf8 in fat/dir.c is too small.

    And cannot handle filename with 255 asian characters when mounted with utf8
    options.

    Also it fix the filename length limitation checking in vfat/namei.c that the
    filename length should be checked against the number of converted unicode
    characters.

    Not the length before NLS/UTF8 converted.

    Signed-off-by: Keith Mok
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keith Mok
     
  • This removes unneeded fat_clusters_flush().

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Currently, free_clusters is not updated until it is trusted, because
    Windows doesn't update it correctly.

    But if user is using FAT driver of Linux, it updates free_clusters
    correctly. Instead, this updates it even if it's untrusted, so if
    free_clustes is correct, now keep correct value.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Normally utime(2) checks current process is owner of the file, or it
    has CAP_FOWNER capability. But FAT filesystem doesn't have uid/gid as
    on disk info, so normal check is too unflexible.

    With this option you can relax it.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Fix fat_setattr() on the case of showexec option. If user specified
    showexec option, inode->i_mode may not have S_IXUGO. This just use
    inode->i_mode to fix it.

    And with this patch, we don't allow chmod() on memory inode, it's just
    bad behaviour. IOW, we allow changing S_IWUGO only which can be stored
    to disk.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • - Rename fat_notify_change() to fat_setattr()
    - check_mode() cleanup
    - Change layout of code

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • FAT doesn't need to check bad inode anymore.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

19 Apr, 2008

1 commit


09 Feb, 2008

1 commit


08 Feb, 2008

2 commits


07 Feb, 2008

2 commits

  • This makes sure printk format strings contain no more than a single line.

    Signed-off-by: Vegard Nossum
    [the message was tweaked.]
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vegard Nossum
     
  • Prohibit mode changes in non-quiet mode that cannot be stored reliably with
    the on-disk format.

    Suppose a vfat filesystem is mounted with umask=0 and [not-quiet]. Then
    all files will have mode 0777. Trying to change the owner will fail,
    because fat does not know about owners or groups. chmod 0770, on the other
    hand, will succeed, even though fat does not know about the permission
    triplet [user/group/other].

    So this patch changes fat's not-quiet behavior so that only UNIX modes are
    accepted that can be mapped lossless between the fat disk format and the
    local system. There is only one attribute, and that is the readonly
    attribute, which is mapped to the UNIX write permission bit(s). chmod 0555
    is therefore valid (taking away the +w bits setting the readonly
    attribute). Since chmod 0775 and chmod 0755 is an ambiguous case as to
    whether to set or clear the readonly bit, these modes are also denied.

    In quiet mode, chmod and chown will continue to "succeed" as they did
    before, meaning that a subsequent stat() will temporarily return the new
    mode as long as the inode is not reread from disk, and chown will silently
    do nothing, not even return the new uid/gid in stat().

    Signed-off-by: Jan Engelhardt
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     

09 Jan, 2008

1 commit

  • On large partition, scanning the free clusters is very slow if users
    doesn't use "usefree" option.

    For optimizing it, this patch uses sb_breadahead() to read of FAT
    sectors. On some user's 15GB partition, this patch improved it very
    much (1min => 600ms).

    The following is the result of 2GB partition on my machine.

    without patch:
    root@devron (/)# time df -h > /dev/null

    real 0m1.202s
    user 0m0.000s
    sys 0m0.440s

    with patch:
    root@devron (/)# time df -h > /dev/null

    real 0m0.378s
    user 0m0.012s
    sys 0m0.168s

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

22 Oct, 2007

2 commits

  • Now that nfsd has stopped writing to the find_exported_dentry member we an
    mark the export_operations const

    Signed-off-by: Christoph Hellwig
    Cc: Neil Brown
    Cc: "J. Bruce Fields"
    Cc:
    Cc: Dave Kleikamp
    Cc: Anton Altaparmakov
    Cc: David Chinner
    Cc: Timothy Shimmin
    Cc: OGAWA Hirofumi
    Cc: Hugh Dickins
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Cc: "Vladimir V. Saveliev"
    Cc: Steven Whitehouse
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Very little changes here, fat had a mostly no op decode_fh before and does not
    store any parent information.

    Signed-off-by: Christoph Hellwig
    Cc: Neil Brown
    Cc: "J. Bruce Fields"
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Oct, 2007

2 commits

  • Slab constructors currently have a flags parameter that is never used. And
    the order of the arguments is opposite to other slab functions. The object
    pointer is placed before the kmem_cache pointer.

    Convert

    ctor(void *object, struct kmem_cache *s, unsigned long flags)

    to

    ctor(struct kmem_cache *s, void *object)

    throughout the kernel

    [akpm@linux-foundation.org: coupla fixes]
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Signed-off-by: Nick Piggin
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

18 Jul, 2007

1 commit

  • currently the export_operation structure and helpers related to it are in
    fs.h. fs.h is already far too large and there are very few places needing the
    export bits, so split them off into a separate header.

    [akpm@linux-foundation.org: fix cifs build]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Neil Brown
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Jul, 2007

2 commits

  • FAT12 entry is 12bits, so it needs 2 phase to update the value. And
    writer and reader access it without any lock, so reader can get the
    half updated value.

    This fixes the long standing race condition by adding a global
    spinlock to only FAT12 for avoiding any impact against FAT16/32.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This patch fixes the following warnings.

    fs/fat/dir.c: In function 'fat_parse_long':
    include/linux/msdos_fs.h:294: warning: array subscript is above array bounds
    include/linux/msdos_fs.h:295: warning: array subscript is above array bounds
    include/linux/msdos_fs.h:295: warning: array subscript is above array bounds

    The ->name is defined as "name[8], ext[3]", but fat_checksum() uses
    those as name[11]. There is no actual problem, but it's not a good manner.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

10 Jul, 2007

1 commit


17 May, 2007

1 commit

  • SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

    Signed-off-by: Christoph Lameter
    Cc: David Howells
    Cc: Jens Axboe
    Cc: Steven French
    Cc: Michael Halcrow
    Cc: OGAWA Hirofumi
    Cc: Miklos Szeredi
    Cc: Steven Whitehouse
    Cc: Roman Zippel
    Cc: David Woodhouse
    Cc: Dave Kleikamp
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Anton Altaparmakov
    Cc: Mark Fasheh
    Cc: Paul Mackerras
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: David Chinner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

09 May, 2007

3 commits

  • If you compile and run the below test case in an msdos or vfat directory on
    an x86-64 system with -m32 you'll get garbage in the kernel_dirent struct
    followed by a SIGSEGV.

    The patch fixes this.

    Reported and initial fix by Bart Oldeman

    #include
    #include
    #include
    #include
    #include
    #include
    struct kernel_dirent {
    long d_ino;
    long d_off;
    unsigned short d_reclen;
    char d_name[256]; /* We must not include limits.h! */
    };
    #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct kernel_dirent [2])
    #define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct kernel_dirent [2])

    int main(void)
    {
    int fd = open(".", O_RDONLY);
    struct kernel_dirent de[2];

    while (1) {
    int i = ioctl(fd, VFAT_IOCTL_READDIR_BOTH, (long)de);
    if (i == -1) break;
    if (de[0].d_reclen == 0) break;
    printf("SFN: reclen=%2d off=%d ino=%d, %-12s",
    de[0].d_reclen, de[0].d_off, de[0].d_ino, de[0].d_name);
    if (de[1].d_reclen)
    printf("\tLFN: reclen=%2d off=%d ino=%d, %s",
    de[1].d_reclen, de[1].d_off, de[1].d_ino, de[1].d_name);
    printf("\n");
    }
    return 0;
    }

    Signed-off-by: Bart Oldeman
    Signed-off-by: OGAWA Hirofumi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • It seems that the recent Windows changed specification, and it's
    undocumented. Windows doesn't update ->free_clusters correctly.

    This patch doesn't use ->free_clusters by default. (instead, add "usefree"
    for forcing to use it)

    Signed-off-by: OGAWA Hirofumi
    Cc: Juergen Beisert
    Cc: Andreas Schwab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Replacing (n & (n-1)) in the context of power of 2 checks with
    is_power_of_2

    Signed-off-by: vignesh babu
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vignesh Babu BM
     

08 May, 2007

1 commit

  • I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by
    SLAB.

    I think its purpose was to have a callback after an object has been freed
    to verify that the state is the constructor state again? The callback is
    performed before each freeing of an object.

    I would think that it is much easier to check the object state manually
    before the free. That also places the check near the code object
    manipulation of the object.

    Also the SLAB_DEBUG_INITIAL callback is only performed if the kernel was
    compiled with SLAB debugging on. If there would be code in a constructor
    handling SLAB_DEBUG_INITIAL then it would have to be conditional on
    SLAB_DEBUG otherwise it would just be dead code. But there is no such code
    in the kernel. I think SLUB_DEBUG_INITIAL is too problematic to make real
    use of, difficult to understand and there are easier ways to accomplish the
    same effect (i.e. add debug code before kfree).

    There is a related flag SLAB_CTOR_VERIFY that is frequently checked to be
    clear in fs inode caches. Remove the pointless checks (they would even be
    pointless without removeal of SLAB_DEBUG_INITIAL) from the fs constructors.

    This is the last slab flag that SLUB did not support. Remove the check for
    unimplemented flags from SLUB.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

21 Feb, 2007

1 commit

  • If the DIO write on FAT is expanding the size, it will be fail by -EINVAL,
    because FAT can't handle it now.

    This patch fallback it to the normal buffered-write and would return
    success.

    Signed-off-by: OGAWA Hirofumi
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

13 Feb, 2007

2 commits

  • This patch is inspired by Arjan's "Patch series to mark struct
    file_operations and struct inode_operations const".

    Compile tested with gcc & sparse.

    Signed-off-by: Josef 'Jeff' Sipek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef 'Jeff' Sipek
     
  • Many struct inode_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

09 Dec, 2006

1 commit


08 Dec, 2006

2 commits

  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • SLAB_KERNEL is an alias of GFP_KERNEL.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

17 Nov, 2006

1 commit