05 Apr, 2014

1 commit

  • Pull ext4 updates from Ted Ts'o:
    "Major changes for 3.14 include support for the newly added ZERO_RANGE
    and COLLAPSE_RANGE fallocate operations, and scalability improvements
    in the jbd2 layer and in xattr handling when the extended attributes
    spill over into an external block.

    Other than that, the usual clean ups and minor bug fixes"

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (42 commits)
    ext4: fix premature freeing of partial clusters split across leaf blocks
    ext4: remove unneeded test of ret variable
    ext4: fix comment typo
    ext4: make ext4_block_zero_page_range static
    ext4: atomically set inode->i_flags in ext4_set_inode_flags()
    ext4: optimize Hurd tests when reading/writing inodes
    ext4: kill i_version support for Hurd-castrated file systems
    ext4: each filesystem creates and uses its own mb_cache
    fs/mbcache.c: doucple the locking of local from global data
    fs/mbcache.c: change block and index hash chain to hlist_bl_node
    ext4: Introduce FALLOC_FL_ZERO_RANGE flag for fallocate
    ext4: refactor ext4_fallocate code
    ext4: Update inode i_size after the preallocation
    ext4: fix partial cluster handling for bigalloc file systems
    ext4: delete path dealloc code in ext4_ext_handle_uninitialized_extents
    ext4: only call sync_filesystm() when remounting read-only
    fs: push sync_filesystem() down to the file system's remount_fs()
    jbd2: improve error messages for inconsistent journal heads
    jbd2: minimize region locked by j_list_lock in jbd2_journal_forget()
    jbd2: minimize region locked by j_list_lock in journal_get_create_access()
    ...

    Linus Torvalds
     

04 Apr, 2014

4 commits

  • hfsplus_create_attr_tree_cache is only called by __init init_hfsplus_fs

    Signed-off-by: Fabian Frederick
    Reviewed-by: Vyacheslav Dubeyko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Concurrent access to alloc_blocks in hfsplus_inode_info() is protected
    by extents_lock mutex. This patch fixes two instances where
    alloc_blocks modification was not protected with this lock.

    This fixes possible allocation bitmap corruption in race conditions
    while extending and truncating files.

    [akpm@linux-foundation.org: take extents_lock before taking a copy of ->alloc_blocks]
    [akpm@linux-foundation.org: remove now-unused label `out']
    Signed-off-by: Sougata Santra
    Reviewed-by: Christoph Hellwig
    Cc: Vyacheslav Dubeyko
    Cc: Alexey Khoroshilov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sougata Santra
     
  • The variable is defined but not used. Generally it compiles away with
    -O2 optimization hence it does not show a warning.

    Signed-off-by: Sougata Santra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sougata Santra
     
  • Reclaim will be leaving shadow entries in the page cache radix tree upon
    evicting the real page. As those pages are found from the LRU, an
    iput() can lead to the inode being freed concurrently. At this point,
    reclaim must no longer install shadow pages because the inode freeing
    code needs to ensure the page tree is really empty.

    Add an address_space flag, AS_EXITING, that the inode freeing code sets
    under the tree lock before doing the final truncate. Reclaim will check
    for this flag before installing shadow pages.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Rik van Riel
    Reviewed-by: Minchan Kim
    Cc: Andrea Arcangeli
    Cc: Bob Liu
    Cc: Christoph Hellwig
    Cc: Dave Chinner
    Cc: Greg Thelen
    Cc: Hugh Dickins
    Cc: Jan Kara
    Cc: KOSAKI Motohiro
    Cc: Luigi Semenzato
    Cc: Mel Gorman
    Cc: Metin Doslu
    Cc: Michel Lespinasse
    Cc: Ozgun Erdogan
    Cc: Peter Zijlstra
    Cc: Roman Gushchin
    Cc: Ryan Mallon
    Cc: Tejun Heo
    Cc: Vlastimil Babka
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

13 Mar, 2014

1 commit

  • Previously, the no-op "mount -o mount /dev/xxx" operation when the
    file system is already mounted read-write causes an implied,
    unconditional syncfs(). This seems pretty stupid, and it's certainly
    documented or guaraunteed to do this, nor is it particularly useful,
    except in the case where the file system was mounted rw and is getting
    remounted read-only.

    However, it's possible that there might be some file systems that are
    actually depending on this behavior. In most file systems, it's
    probably fine to only call sync_filesystem() when transitioning from
    read-write to read-only, and there are some file systems where this is
    not needed at all (for example, for a pseudo-filesystem or something
    like romfs).

    Signed-off-by: "Theodore Ts'o"
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Christoph Hellwig
    Cc: Artem Bityutskiy
    Cc: Adrian Hunter
    Cc: Evgeniy Dushistov
    Cc: Jan Kara
    Cc: OGAWA Hirofumi
    Cc: Anders Larsen
    Cc: Phillip Lougher
    Cc: Kees Cook
    Cc: Mikulas Patocka
    Cc: Petr Vandrovec
    Cc: xfs@oss.sgi.com
    Cc: linux-btrfs@vger.kernel.org
    Cc: linux-cifs@vger.kernel.org
    Cc: samba-technical@lists.samba.org
    Cc: codalist@coda.cs.cmu.edu
    Cc: linux-ext4@vger.kernel.org
    Cc: linux-f2fs-devel@lists.sourceforge.net
    Cc: fuse-devel@lists.sourceforge.net
    Cc: cluster-devel@redhat.com
    Cc: linux-mtd@lists.infradead.org
    Cc: jfs-discussion@lists.sourceforge.net
    Cc: linux-nfs@vger.kernel.org
    Cc: linux-nilfs@vger.kernel.org
    Cc: linux-ntfs-dev@lists.sourceforge.net
    Cc: ocfs2-devel@oss.oracle.com
    Cc: reiserfs-devel@vger.kernel.org

    Theodore Ts'o
     

11 Mar, 2014

1 commit

  • Adds support for HFSX 'HasFolderCount' flag and a corresponding
    'folderCount' field in folder records. (For reference see
    HFS_FOLDERCOUNT and kHFSHasFolderCountBit/kHFSHasFolderCountMask in
    Apple's source code.)

    Ignoring subfolder count leads to fs errors found by Mac:

    ...
    Checking catalog hierarchy.
    HasFolderCount flag needs to be set (id = 105)
    (It should be 0x10 instead of 0)
    Incorrect folder count in a directory (id = 2)
    (It should be 7 instead of 6)
    ...

    Steps to reproduce:
    Format with "newfs_hfs -s /dev/diskXXX".
    Mount in Linux.
    Create a new directory in root.
    Unmount.
    Run "fsck_hfs /dev/diskXXX".

    The patch handles directory creation, deletion, and rename.

    Signed-off-by: Sergei Antonov
    Reviewed-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergei Antonov
     

04 Mar, 2014

1 commit

  • Current implementation of HFS+ driver has small issue with remount
    option. Namely, for example, you are unable to remount from RO mode
    into RW mode by means of command "mount -o remount,rw /dev/loop0
    /mnt/hfsplus". Trying to execute sequence of commands results in an
    error message:

    mount /dev/loop0 /mnt/hfsplus
    mount -o remount,ro /dev/loop0 /mnt/hfsplus
    mount -o remount,rw /dev/loop0 /mnt/hfsplus

    mount: you must specify the filesystem type

    mount -t hfsplus -o remount,rw /dev/loop0 /mnt/hfsplus

    mount: /mnt/hfsplus not mounted or bad option

    The reason of such issue is failure of mount syscall:

    mount("/dev/loop0", "/mnt/hfsplus", 0x2282a60, MS_MGC_VAL|MS_REMOUNT, NULL) = -1 EINVAL (Invalid argument)

    Namely, hfsplus_parse_options_remount() method receives empty "input"
    argument and return false in such case. As a result, hfsplus_remount()
    returns -EINVAL error code.

    This patch fixes the issue by means of return true for the case of empty
    "input" argument in hfsplus_parse_options_remount() method.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     

02 Feb, 2014

1 commit


01 Feb, 2014

1 commit

  • hfsplus was already using the handlers for get and set operations,
    and with the removal of can_set_xattr we've now allow operations that
    wouldn't otherwise be allowed.

    With this we can also centralize the special-casing of the osx.
    attrs that don't have prefixes on disk in the osx xattr handlers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

31 Jan, 2014

1 commit

  • Pull core block IO changes from Jens Axboe:
    "The major piece in here is the immutable bio_ve series from Kent, the
    rest is fairly minor. It was supposed to go in last round, but
    various issues pushed it to this release instead. The pull request
    contains:

    - Various smaller blk-mq fixes from different folks. Nothing major
    here, just minor fixes and cleanups.

    - Fix for a memory leak in the error path in the block ioctl code
    from Christian Engelmayer.

    - Header export fix from CaiZhiyong.

    - Finally the immutable biovec changes from Kent Overstreet. This
    enables some nice future work on making arbitrarily sized bios
    possible, and splitting more efficient. Related fixes to immutable
    bio_vecs:

    - dm-cache immutable fixup from Mike Snitzer.
    - btrfs immutable fixup from Muthu Kumar.

    - bio-integrity fix from Nic Bellinger, which is also going to stable"

    * 'for-3.14/core' of git://git.kernel.dk/linux-block: (44 commits)
    xtensa: fixup simdisk driver to work with immutable bio_vecs
    block/blk-mq-cpu.c: use hotcpu_notifier()
    blk-mq: for_each_* macro correctness
    block: Fix memory leak in rw_copy_check_uvector() handling
    bio-integrity: Fix bio_integrity_verify segment start bug
    block: remove unrelated header files and export symbol
    blk-mq: uses page->list incorrectly
    blk-mq: use __smp_call_function_single directly
    btrfs: fix missing increment of bi_remaining
    Revert "block: Warn and free bio if bi_end_io is not set"
    block: Warn and free bio if bi_end_io is not set
    blk-mq: fix initializing request's start time
    block: blk-mq: don't export blk_mq_free_queue()
    block: blk-mq: make blk_sync_queue support mq
    block: blk-mq: support draining mq queue
    dm cache: increment bi_remaining when bi_end_io is restored
    block: fixup for generic bio chaining
    block: Really silence spurious compiler warnings
    block: Silence spurious compiler warnings
    block: Kill bio_pair_split()
    ...

    Linus Torvalds
     

29 Jan, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "Assorted stuff; the biggest pile here is Christoph's ACL series. Plus
    assorted cleanups and fixes all over the place...

    There will be another pile later this week"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (43 commits)
    __dentry_path() fixes
    vfs: Remove second variable named error in __dentry_path
    vfs: Is mounted should be testing mnt_ns for NULL or error.
    Fix race when checking i_size on direct i/o read
    hfsplus: remove can_set_xattr
    nfsd: use get_acl and ->set_acl
    fs: remove generic_acl
    nfs: use generic posix ACL infrastructure for v3 Posix ACLs
    gfs2: use generic posix ACL infrastructure
    jfs: use generic posix ACL infrastructure
    xfs: use generic posix ACL infrastructure
    reiserfs: use generic posix ACL infrastructure
    ocfs2: use generic posix ACL infrastructure
    jffs2: use generic posix ACL infrastructure
    hfsplus: use generic posix ACL infrastructure
    f2fs: use generic posix ACL infrastructure
    ext2/3/4: use generic posix ACL infrastructure
    btrfs: use generic posix ACL infrastructure
    fs: make posix_acl_create more useful
    fs: make posix_acl_chmod more useful
    ...

    Linus Torvalds
     

26 Jan, 2014

4 commits


24 Jan, 2014

1 commit

  • HFS+ resource fork lookup breaks opendir() library function. Since
    opendir first calls open() with O_DIRECTORY flag set. O_DIRECTORY means
    "refuse to open if not a directory". The open system call in the kernel
    does a check for inode->i_op->lookup and returns -ENOTDIR. So if
    hfsplus_file_lookup is set it allows opendir() for plain files.

    Also resource fork lookup in HFS+ does not work. Since it is never
    invoked after VFS permission checking. It will always return with
    -EACCES.

    When we call opendir() on a file, it does not return NULL. opendir()
    library call is based on open with O_DIRECTORY flag passed and then
    layered on top of getdents() system call. O_DIRECTORY means "refuse to
    open if not a directory".

    The open() system call in the kernel does a check for: do_sys_open()
    -->..--> can_lookup() i.e it only checks inode->i_op->lookup and returns
    ENOTDIR if this function pointer is not set.

    In OSX, we can open "file/rsrc" to get the resource fork of "file". This
    behavior is emulated inside hfsplus on Linux, which means that to some
    degree every file acts like a directory. That is the reason lookup()
    inode operations is supported for files, and it is possible to do a lookup
    on this specific name. As a result of this open succeeds without
    returning ENOTDIR for HFS+

    Please see the LKML discussion thread on this issue:
    http://marc.info/?l=linux-fsdevel&m=122823343730412&w=2

    I tried to test file/rsrc lookup in HFS+ driver and the feature does not
    work. From OSX:

    $ touch test
    $ echo "1234" > test/..namedfork/rsrc
    $ ls -l test..namedfork/rsrc
    --rw-r--r-- 1 tuxera staff 5 10 dec 12:59 test/..namedfork/rsrc

    [sougata@ultrabook tmp]$ id
    uid=1000(sougata) gid=1000(sougata) groups=1000(sougata),5(tty),18(dialout),1001(vboxusers)

    [sougata@ultrabook tmp]$ mount
    /dev/sdb1 on /mnt/tmp type hfsplus (rw,relatime,umask=0,uid=1000,gid=1000,nls=utf8)

    [sougata@ultrabook tmp]$ ls -l test/rsrc
    ls: cannot access test/rsrc: Permission denied

    According to this LKML thread it is expected behavior.

    http://marc.info/?t=121139033800008&r=1&w=4

    I guess now that permission checking happens in vfs generic_permission() ?
    So it turns out that even though the lookup() inode_operation exists for
    HFS+ files. It cannot really get invoked ?. So if we can disable this
    feature to make opendir() work for HFS+.

    Signed-off-by: Sougata Santra
    Acked-by: Christoph Hellwig
    Cc: Vyacheslav Dubeyko
    Cc: Anton Altaparmakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sougata Santra
     

25 Nov, 2013

1 commit


24 Nov, 2013

2 commits

  • Immutable biovecs are going to require an explicit iterator. To
    implement immutable bvecs, a later patch is going to add a bi_bvec_done
    member to this struct; for now, this patch effectively just renames
    things.

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: Geert Uytterhoeven
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Ed L. Cashin"
    Cc: Nick Piggin
    Cc: Lars Ellenberg
    Cc: Jiri Kosina
    Cc: Matthew Wilcox
    Cc: Geoff Levand
    Cc: Yehuda Sadeh
    Cc: Sage Weil
    Cc: Alex Elder
    Cc: ceph-devel@vger.kernel.org
    Cc: Joshua Morris
    Cc: Philip Kelleher
    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: Konrad Rzeszutek Wilk
    Cc: Jeremy Fitzhardinge
    Cc: Neil Brown
    Cc: Alasdair Kergon
    Cc: Mike Snitzer
    Cc: dm-devel@redhat.com
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux390@de.ibm.com
    Cc: Boaz Harrosh
    Cc: Benny Halevy
    Cc: "James E.J. Bottomley"
    Cc: Greg Kroah-Hartman
    Cc: "Nicholas A. Bellinger"
    Cc: Alexander Viro
    Cc: Chris Mason
    Cc: "Theodore Ts'o"
    Cc: Andreas Dilger
    Cc: Jaegeuk Kim
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: Prasad Joshi
    Cc: Trond Myklebust
    Cc: KONISHI Ryusuke
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Ben Myers
    Cc: xfs@oss.sgi.com
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Herton Ronaldo Krzesinski
    Cc: Ben Hutchings
    Cc: Andrew Morton
    Cc: Guo Chao
    Cc: Tejun Heo
    Cc: Asai Thambi S P
    Cc: Selvan Mani
    Cc: Sam Bradshaw
    Cc: Wei Yongjun
    Cc: "Roger Pau Monné"
    Cc: Jan Beulich
    Cc: Stefano Stabellini
    Cc: Ian Campbell
    Cc: Sebastian Ott
    Cc: Christian Borntraeger
    Cc: Minchan Kim
    Cc: Jiang Liu
    Cc: Nitin Gupta
    Cc: Jerome Marchand
    Cc: Joe Perches
    Cc: Peng Tao
    Cc: Andy Adamson
    Cc: fanchaoting
    Cc: Jie Liu
    Cc: Sunil Mushran
    Cc: "Martin K. Petersen"
    Cc: Namjae Jeon
    Cc: Pankaj Kumar
    Cc: Dan Magenheimer
    Cc: Mel Gorman 6

    Kent Overstreet
     
  • It was being open coded in a few places.

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: Joern Engel
    Cc: Prasad Joshi
    Cc: Neil Brown
    Cc: Chris Mason
    Acked-by: NeilBrown

    Kent Overstreet
     

15 Nov, 2013

1 commit

  • ERROR: "__divdi3" [fs/hfsplus/hfsplus.ko] undefined!

    Introduced by commit 099e9245e04d ("hfsplus: implement attributes file's
    header node initialization code").

    i_size_read() returns loff_t, which is long long, i.e. 64-bit. node_size
    is size_t, which is either 32-bit or 64-bit. Hence
    "i_size_read(attr_file) / node_size" is a 64-by-32 or 64-by-64 division,
    causing (some versions of) gcc to emit a call to __divdi3().

    Fortunately node_size is actually 16-bit, as the sole caller of
    hfsplus_init_header_node() passes a u16. Hence change its type from
    size_t to u16, and use do_div() to perform a 64-by-32 division.

    Not seen in m68k/allmodconfig in -next, so it really depends on the
    verion of gcc.

    Signed-off-by: Geert Uytterhoeven
    Cc: Vyacheslav Dubeyko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

13 Nov, 2013

4 commits

  • Implement functionality of creation AttributesFile metadata file on HFS+
    volume in the case of absence of it.

    It makes trying to open AttributesFile's B-tree during mount of HFS+
    volume. If HFS+ volume hasn't AttributesFile then a pointer on
    AttributesFile's B-tree keeps as NULL. Thereby, when it is discovered
    absence of AttributesFile on HFS+ volume in the begin of xattr creation
    operation then AttributesFile will be created.

    The creation of AttributesFile will have success in the case of
    availability (2 * clump) free blocks on HFS+ volume. Otherwise,
    creation operation is ended with error (-ENOSPC).

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Acked-by: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • Implement functionality of AttributesFile's header node initialization.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • There are situation when HFS+ volume had been created without
    AttributesFile. Such situation can take place because of using old
    mkfs.hfs utility or creation HFS+ volume without taking in mind
    necessity to use xattrs. For example, Mac OS X 10.4 (Tiger) doesn't
    create AttributesFile during mkfs phase. Also it is a very frequent
    situation for the case of users that created HFS+ volumes under Linux.
    As a result, xattrs and POSIX ACLs on HFS+ volume are unavailable for
    such users.

    This patchset implements functionality of AttributesFile creation on
    HFS+ volume in the case of this metadata file absence during operation
    of xattr creation.

    This patch:

    Add functionality of metadata file's clump size calculation. Operation
    of AttributesFile creation needs in clump size setting. This value will
    be used when AttributesFile will be extended.

    This code is adopted from code of newfs_hfs utility of diskdev_cmds packet
    http://opensource.apple.com/tarballs/diskdev_cmds/.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • This patch removes duplicate defines from fs/hfs/btree.h

    [akpm@linux-foundation.org: retain the comments]
    Signed-off-by: Michael Opdenacker
    Reviewed-by: Vyacheslav Dubeyko
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Opdenacker
     

13 Sep, 2013

1 commit


12 Sep, 2013

3 commits

  • Integrate implemented POSIX ACLs support into hfsplus driver.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • Implement POSIX ACLs support in hfsplus driver.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • This patchset implements POSIX ACLs support in hfsplus driver.

    Mac OS X beginning with version 10.4 ("Tiger") support NFSv4 ACLs, which
    are part of the NFSv4 standard. HFS+ stores ACLs in the form of
    specially named extended attributes (com.apple.system.Security).

    But this patchset doesn't use "com.apple.system.Security" extended
    attributes. It implements support of POSIX ACLs in the form of extended
    attributes with names "system.posix_acl_access" and
    "system.posix_acl_default". These xattrs are treated only under Linux.
    POSIX ACLs doesn't mean something under Mac OS X. Thereby, this patch
    set provides opportunity to use POSIX ACLs under Linux on HFS+
    filesystem.

    This patch:

    Add CONFIG_HFSPLUS_FS_POSIX_ACL kernel configuration option, DBG_ACL_MOD
    debugging flag and acl.h file with declaration of essential functions
    for support POSIX ACLs in hfsplus driver.

    Signed-off-by: Vyacheslav Dubeyko
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     

29 Jun, 2013

2 commits

  • Instances either don't look at it at all (the majority of cases) or
    only want it to find the superblock (which can be had as dentry->d_sb).
    A few cases that want more are actually safe with dentry->d_inode -
    the only precaution needed is the check that it hadn't been replaced with
    NULL by rmdir() or by overwriting rename(), which case should be simply
    treated as cache miss.

    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro

    Linus Torvalds
     
  • Signed-off-by: Al Viro

    Al Viro
     

08 May, 2013

1 commit

  • Faster kernel compiles by way of fewer unnecessary includes.

    [akpm@linux-foundation.org: fix fallout]
    [akpm@linux-foundation.org: fix build]
    Signed-off-by: Kent Overstreet
    Cc: Zach Brown
    Cc: Felipe Balbi
    Cc: Greg Kroah-Hartman
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Rusty Russell
    Cc: Jens Axboe
    Cc: Asai Thambi S P
    Cc: Selvan Mani
    Cc: Sam Bradshaw
    Cc: Jeff Moyer
    Cc: Al Viro
    Cc: Benjamin LaHaise
    Reviewed-by: "Theodore Ts'o"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kent Overstreet
     

01 May, 2013

5 commits

  • Signed-off-by: Vyacheslav Dubeyko
    Cc: Christoph Hellwig
    Cc: Al Viro
    Cc: Hin-Tak Leung
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • __hfsplus_ext_write_extent() suppresses errors coming from
    hfs_brec_find(). The patch implements error code propagation.

    Signed-off-by: Alexey Khoroshilov
    Reviewed-by: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Al Viro
    Cc: Artem Bityutskiy
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Khoroshilov
     
  • Use a more current logging style.

    Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    hfsplus now uses "hfsplus: " for all messages.
    Coalesce formats.
    Prefix debugging messages too.

    Signed-off-by: Joe Perches
    Cc: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Use a more current logging style.

    Rename macro and uses.
    Add do {} while (0) to macro.
    Add DBG_ to macro.
    Add and use hfs_dbg_cont variant where appropriate.

    Signed-off-by: Joe Perches
    Cc: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • fs/hfsplus/bfind.c: In function 'hfs_find_1st_rec_by_cnid':
    (1) include/uapi/linux/swab.h:60:2: warning: 'search_cnid' may be used uninitialized in this function [-Wmaybe-uninitialized]
    (2) include/uapi/linux/swab.h:60:2: warning: 'cur_cnid' may be used uninitialized in this function [-Wmaybe-uninitialized]

    [akpm@linux-foundation.org: make the workaround more explicit]
    Signed-off-by: Vyacheslav Dubeyko
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     

18 Apr, 2013

1 commit


04 Mar, 2013

1 commit

  • Modify the request_module to prefix the file system type with "fs-"
    and add aliases to all of the filesystems that can be built as modules
    to match.

    A common practice is to build all of the kernel code and leave code
    that is not commonly needed as modules, with the result that many
    users are exposed to any bug anywhere in the kernel.

    Looking for filesystems with a fs- prefix limits the pool of possible
    modules that can be loaded by mount to just filesystems trivially
    making things safer with no real cost.

    Using aliases means user space can control the policy of which
    filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf
    with blacklist and alias directives. Allowing simple, safe,
    well understood work-arounds to known problematic software.

    This also addresses a rare but unfortunate problem where the filesystem
    name is not the same as it's module name and module auto-loading
    would not work. While writing this patch I saw a handful of such
    cases. The most significant being autofs that lives in the module
    autofs4.

    This is relevant to user namespaces because we can reach the request
    module in get_fs_type() without having any special permissions, and
    people get uncomfortable when a user specified string (in this case
    the filesystem type) goes all of the way to request_module.

    After having looked at this issue I don't think there is any
    particular reason to perform any filtering or permission checks beyond
    making it clear in the module request that we want a filesystem
    module. The common pattern in the kernel is to call request_module()
    without regards to the users permissions. In general all a filesystem
    module does once loaded is call register_filesystem() and go to sleep.
    Which means there is not much attack surface exposed by loading a
    filesytem module unless the filesystem is mounted. In a user
    namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT,
    which most filesystems do not set today.

    Acked-by: Serge Hallyn
    Acked-by: Kees Cook
    Reported-by: Kees Cook
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

28 Feb, 2013

1 commit

  • The fsck_hfs (under MacOS X) complains about unzeroed unused b-tree nodes
    after deletion of folders' tree under Linux.

    SYMPTOMS:

    Running Disk Utiltiy's "Verify Disk" on "test" gives the following:
    Verifying volume “Test”
    Checking file systemChecking Journaled HFS Plus volume.
    Checking extents overflow file.
    Checking catalog file.
    Unused node is not erased (node = 3111)
    Checking multi-linked files.
    Checking catalog hierarchy.
    Checking extended attributes file.
    Checking volume bitmap.
    Checking volume information.
    The volume Test was found corrupt and needs to be repaired.
    Error: This disk needs to be repaired. Click Repair Disk.

    REPRODUCING PATH:

    1. Prepare HFS+ (non-case sensitive) partition (for example, 5GB)
    under MacOS X.
    2. Copy linux kernel source tree (for example, 3.7-rc6 version) on
    this partition under MacOS X.
    3. Then switch to Linux and mount this prepared partition.
    4. Execute `sudo rm -r` under prepared directory with linux kernel
    source tree.
    5. Unmount and boot back into OS X.
    6. Open up Disk Utility and verify partition.

    REPRODUCIBILITY: 100%

    FIX:

    It is added code of node clearing in hfs_bnode_put() method for the case
    when node has flag HFS_BNODE_DELETED.

    Signed-off-by: Vyacheslav Dubeyko
    Reported-by: Kyle Laracey
    Acked-by: Hin-Tak Leung
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko