01 Nov, 2011

1 commit


17 Aug, 2011

1 commit

  • This fixes a compile warning (unititialized variable) in
    the fat filesystem code.

    Signed-off-by: Jonas Aberg
    Signed-off-by: Lee Jones
    Signed-off-by: Linus Walleij
    Signed-off-by: OGAWA Hirofumi

    Jonas Aberg
     

12 Apr, 2011

1 commit


17 May, 2010

1 commit

  • FAT does not require the BKL in its ioctl function, which is already serialized
    through a mutex. Since we're already touching the ioctl code, also fix the
    missing handling of FAT_IOCTL_GET_ATTRIBUTES in the compat code.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: OGAWA Hirofumi

    Arnd Bergmann
     

16 Mar, 2010

1 commit


13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

17 Jun, 2009

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (143 commits)
    USB: xhci depends on PCI.
    USB: xhci: Add Makefile, MAINTAINERS, and Kconfig entries.
    USB: xhci: Respect critical sections.
    USB: xHCI: Fix interrupt moderation.
    USB: xhci: Remove packed attribute from structures.
    usb; xhci: Fix TRB offset calculations.
    USB: xhci: replace if-elseif-else with switch-case
    USB: xhci: Make xhci-mem.c include linux/dmapool.h
    USB: xhci: drop spinlock in xhci_urb_enqueue() error path.
    USB: Change names of SuperSpeed ep companion descriptor structs.
    USB: xhci: Avoid compiler reordering in Link TRB giveback.
    USB: xhci: Clean up xhci_irq() function.
    USB: xhci: Avoid global namespace pollution.
    USB: xhci: Fix Link TRB handoff bit twiddling.
    USB: xhci: Fix register write order.
    USB: xhci: fix some compiler warnings in xhci.h
    USB: xhci: fix lots of compiler warnings.
    USB: xhci: use xhci_handle_event instead of handle_event
    USB: xhci: URB cancellation support.
    USB: xhci: Scatter gather list support for bulk transfers.
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6:
    fat: split fat_generic_ioctl
    FAT: add 'errors' mount option

    Linus Torvalds
     

16 Jun, 2009

1 commit

  • This patch (as1239) updates the kernel's treatment of Unicode. The
    character-set conversion routines are well behind the current state of
    the Unicode specification: They don't recognize the existence of code
    points beyond plane 0 or of surrogate pairs in the UTF-16 encoding.

    The old wchar_t 16-bit type is retained because it's still used in
    lots of places. This shouldn't cause any new problems; if a
    conversion now results in an invalid 16-bit code then before it must
    have yielded an undefined code.

    Difficult-to-read names like "utf_mbstowcs" are replaced with more
    transparent names like "utf8s_to_utf16s" and the ordering of the
    parameters is rationalized (buffer lengths come immediate after the
    pointers they refer to, and the inputs precede the outputs).
    Fortunately the low-level conversion routines are used in only a few
    places; the interfaces to the higher-level uni2char and char2uni
    methods have been left unchanged.

    Signed-off-by: Alan Stern
    Acked-by: Clemens Ladisch
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

12 Jun, 2009

1 commit

  • * mark directory data blocks as assoc. metadata
    * add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
    * now ->fsync() is trivial both for files and directories

    Signed-off-by: Al Viro

    Al Viro
     

04 Jun, 2009

1 commit

  • On severe errors FAT remounts itself in read-only mode. Allow to
    specify FAT fs desired behavior through 'errors' mount option:
    panic, continue or remount read-only.

    `mount -t [fat|vfat] -o errors=[panic,remount-ro,continue] \
    `

    This is analog to ext2 fs 'errors' mount option.

    Signed-off-by: Denis Karpov
    Signed-off-by: OGAWA Hirofumi

    Denis Karpov
     

12 Nov, 2008

1 commit


07 Nov, 2008

6 commits

  • blkcnt_t type depends on CONFIG_LSF. Use unsigned long long always for
    printk(). But lazy to type it, so add "llu" and use it.

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

    OGAWA Hirofumi
     
  • mmu_private is 64bits value, hence it's not atomic to update.

    So, the access rule for mmu_private is we must hold ->i_mutex. But,
    fat_get_block() path doesn't follow the rule on non-allocation path.

    This fixes by using i_size instead if non-allocation path.

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

    OGAWA Hirofumi
     
  • Coverity CID 2332 & 2333 RESOURCE_LEAK

    In fat_search_long() if fat_parse_long() returns a -ve value we return
    without first freeing unicode. This patch free's them on this error path.

    The above was false positive on current tree, but this change is more
    clean, so apply as cleanup.

    [hirofumi@mail.parknet.co.jp: fix coding style]
    Signed-off-by: Darren Jenkins
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darren Jenkins
     
  • Since fat_dir_ioctl() was already fixed (i.e. called under ->i_mutex),
    and __fat_readdir() doesn't take BKL anymore. So, BKL for ->llseek()
    is pointless, and we have to use generic_file_llseek().

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

    OGAWA Hirofumi
     
  • This cleans date_dos2unix()/fat_date_unix2dos() up. New code should be
    much more readable.

    And this fixes those old functions. Those doesn't handle 2100
    correctly. 2100 isn't leap year, but old one handles it as leap year.
    Also, with this, centi sec is handled and is fixed.

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

    OGAWA Hirofumi
     
  • This splits __KERNEL__ stuff in include/msdos_fs.h into fs/fat/fat.h.

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

    OGAWA Hirofumi
     

23 Oct, 2008

1 commit


26 Jul, 2008

5 commits

  • Provide a new mount option ("tz=UTC") for DOS (vfat/msdos) filesystems,
    allowing timestamps to be in coordinated universal time (UTC) rather than
    local time in applications where doing this is advantageous.

    In particular, portable devices that use fat/vfat (such as digital
    cameras) can benefit from using UTC in their internal clocks, thus
    avoiding daylight saving time errors and general time ambiguity issues.
    The user of the device does not have to worry about changing the time when
    moving from place or when daylight saving changes.

    The new mount option, when set, disables the counter-adjustment that Linux
    currently makes to FAT timestamp info in anticipation of the normal
    userspace time zone correction. When used in this new mode, all daylight
    saving time and time zone handling is done in userspace as is normal for
    many other filesystems (like ext3). The default mode, which remains
    unchanged, is still appropriate when mounting volumes written in Windows
    (because of its use of local time).

    I originally based this patch on one submitted last year by Paul Collins,
    but I updated it to work with current source and changed variable/option
    naming. Ogawa Hirofumi (who maintains these filesystems) and I discussed
    this patch at length on lkml, and he suggested using the option name in
    the attached version of the patch. Barry Bouwsma pointed out a good
    addition to the patch as well.

    Signed-off-by: Joe Peterson
    Signed-off-by: Paul Collins
    Acked-by: OGAWA Hirofumi
    Cc: Barry Bouwsma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Peterson
     
  • This removes unnecessary parsing for directory entries.

    If short_only, we don't need to parse longname. And if !both and it found
    the longname, we don't need shortname.

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

    OGAWA Hirofumi
     
  • This uses uses stack for shortname, and uses __getname() for longname in
    fat_search_long() and __fat_readdir(). By this, it removes unneeded
    __getname() for shortname.

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

    OGAWA Hirofumi
     
  • This is no logic changes, just cleans fs/fat/dir.c up.

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

    OGAWA Hirofumi
     
  • struct __fat_dirent is what was formerly the kernel struct dirent (that
    was different from the userspace struct dirent).

    Converting all fat users to struct __fat_dirent will allow us to get rid
    of the conflicting struct dirent definition.

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

    Adrian Bunk
     

21 Jun, 2008

1 commit

  • This replaces the use of the BKL in the FAT family of filesystems with the
    existing superblock lock instead.

    The code already appears to do mostly proper locking with its own private
    spinlocks (and mutexes), but while the BKL could possibly have been
    dropped entirely, converting it to use the superblock lock (which is just
    a regular mutex) is the conservative thing to do.

    As a per-filesystem mutex, it not only won't have any of the possible
    latency issues related to the BKL, but the lock is obviously private to
    the particular filesystem instance and will thus not cause problems for
    entirely unrelated users like the BKL can.

    Signed-off-by: Linus Torvalds
    Cc: OGAWA Hirofumi
    Signed-off-by: Jonathan Corbet

    Linus Torvalds
     

28 Apr, 2008

2 commits

  • __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
     

17 Jul, 2007

1 commit

  • 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
     

09 May, 2007

1 commit

  • 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
     

09 Dec, 2006

1 commit


03 Oct, 2006

1 commit

  • These patches make the kernel pass 64-bit inode numbers internally when
    communicating to userspace, even on a 32-bit system. They are required
    because some filesystems have intrinsic 64-bit inode numbers: NFS3+ and XFS
    for example. The 64-bit inode numbers are then propagated to userspace
    automatically where the arch supports it.

    Problems have been seen with userspace (eg: ld.so) using the 64-bit inode
    number returned by stat64() or getdents64() to differentiate files, and
    failing because the 64-bit inode number space was compressed to 32-bits, and
    so overlaps occur.

    This patch:

    Make filldir_t take a 64-bit inode number and struct kstat carry a 64-bit
    inode number so that 64-bit inode numbers can be passed back to userspace.

    The stat functions then returns the full 64-bit inode number where
    available and where possible. If it is not possible to represent the inode
    number supplied by the filesystem in the field provided by userspace, then
    error EOVERFLOW will be issued.

    Similarly, the getdents/readdir functions now pass the full 64-bit inode
    number to userspace where possible, returning EOVERFLOW instead when a
    directory entry is encountered that can't be properly represented.

    Note that this means that some inodes will not be stat'able on a 32-bit
    system with old libraries where they were before - but it does mean that
    there will be no ambiguity over what a 32-bit inode number refers to.

    Note similarly that directory scans may be cut short with an error on a
    32-bit system with old libraries where the scan would work before for the
    same reasons.

    It is judged unlikely that this situation will occur because modern glibc
    uses 64-bit capable versions of stat and getdents class functions
    exclusively, and that older systems are unlikely to encounter
    unrepresentable inode numbers anyway.

    [akpm: alpha build fix]
    Signed-off-by: David Howells
    Cc: Trond Myklebust
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

01 Oct, 2006

1 commit


29 Mar, 2006

1 commit

  • This is a conversion to make the various file_operations structs in fs/
    const. Basically a regexp job, with a few manual fixups

    The goal is both to increase correctness (harder to accidentally write to
    shared datastructures) and reducing the false sharing of cachelines with
    things that get dirty in .data (while .rodata is nicely read only and thus
    cache clean)

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

    Arjan van de Ven
     

22 Mar, 2006

1 commit


10 Jan, 2006

1 commit


09 Jan, 2006

3 commits


31 Oct, 2005

2 commits