1. 02 3月, 2017 1 次提交
  2. 08 10月, 2016 1 次提交
  3. 28 9月, 2016 1 次提交
  4. 22 9月, 2016 1 次提交
  5. 30 5月, 2016 1 次提交
  6. 13 5月, 2016 1 次提交
    • A
      hfsplus: switch to ->iterate_shared() · 323ee8fc
      Al Viro 提交于
      We need to protect the list of hfsplus_readdir_data against parallel
      insertions (in readdir) and removals (in release).  Add a spinlock
      for that.  Note that it has nothing to do with protection of
      hfsplus_readdir_data->key - we have an exclusion between hfsplus_readdir()
      and hfsplus_delete_cat() on directory lock and between several
      hfsplus_readdir() for the same struct file on ->f_pos_lock.  The spinlock
      is strictly for list changes.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      323ee8fc
  7. 02 5月, 2016 1 次提交
  8. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  9. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  10. 09 12月, 2015 1 次提交
    • A
      don't put symlink bodies in pagecache into highmem · 21fc61c7
      Al Viro 提交于
      kmap() in page_follow_link_light() needed to go - allowing to hold
      an arbitrary number of kmaps for long is a great way to deadlocking
      the system.
      
      new helper (inode_nohighmem(inode)) needs to be used for pagecache
      symlinks inodes; done for all in-tree cases.  page_follow_link_light()
      instrumented to yell about anything missed.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      21fc61c7
  11. 17 4月, 2015 1 次提交
    • S
      hfsplus: fix expand when not enough available space · 059a704c
      Sergei Antonov 提交于
      Fix a bug which is reproduced as follows. Create a file:
      
       echo abc > test_file
      
      Try to expand the file beyond available space:
      
       truncate --size=<size exceeding available space> test_file
      
      Since HFS+ does not support file size > allocated size, truncate should
      fail.  However, it ends successfully.  The driver returns success despite
      having been unable to allocate the requested space for the file.  Also
      filesystem check finds an error:
      
       Checking catalog file.
       Incorrect size for file test_file
       (It should be 469094400 instead of 1000000000)
      
      Add a piece of code analogous to code in the fat driver.  Now a proper
      error is returned and filesystem remains consistent.
      Signed-off-by: NSergei Antonov <saproj@gmail.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
      Reviewed-by: NAnton Altaparmakov <anton@tuxera.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Sougata Santra <sougata@tuxera.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      059a704c
  12. 16 4月, 2015 1 次提交
  13. 12 4月, 2015 4 次提交
  14. 26 3月, 2015 1 次提交
  15. 07 5月, 2014 5 次提交
  16. 11 3月, 2014 1 次提交
    • S
      hfsplus: add HFSX subfolder count support · d7d673a5
      Sergei Antonov 提交于
      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: NSergei Antonov <saproj@gmail.com>
      Reviewed-by: NVyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7d673a5
  17. 01 2月, 2014 1 次提交
  18. 26 1月, 2014 1 次提交
  19. 24 1月, 2014 1 次提交
    • S
      hfsplus: remove hfsplus_file_lookup() · d74a054f
      Sougata Santra 提交于
      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: NSougata Santra <sougata@tuxera.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Anton Altaparmakov <aia21@cam.ac.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d74a054f
  20. 13 9月, 2013 1 次提交
  21. 12 9月, 2013 1 次提交
  22. 08 5月, 2013 1 次提交
  23. 01 5月, 2013 1 次提交
  24. 28 2月, 2013 1 次提交
  25. 23 2月, 2013 1 次提交
  26. 21 12月, 2012 1 次提交
  27. 21 9月, 2012 1 次提交
  28. 23 7月, 2012 1 次提交
    • A
      hfsplus: get rid of write_super · 9e6c5829
      Artem Bityutskiy 提交于
      This patch makes hfsplus stop using the VFS '->write_super()' method along with
      the 's_dirt' superblock flag, because they are on their way out.
      
      The whole "superblock write-out" VFS infrastructure is served by the
      'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
      writes out all dirty superblocks using the '->write_super()' call-back.  But the
      problem with this thread is that it wastes power by waking up the system every
      5 seconds, even if there are no diry superblocks, or there are no client
      file-systems which would need this (e.g., btrfs does not use
      '->write_super()'). So we want to kill it completely and thus, we need to make
      file-systems to stop using the '->write_super()' VFS service, and then remove
      it together with the kernel thread.
      
      Tested using fsstress from the LTP project.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9e6c5829
  29. 14 7月, 2012 1 次提交
    • A
      stop passing nameidata to ->lookup() · 00cd8dd3
      Al Viro 提交于
      Just the flags; only NFS cares even about that, but there are
      legitimate uses for such argument.  And getting rid of that
      completely would require splitting ->lookup() into a couple
      of methods (at least), so let's leave that alone for now...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      00cd8dd3
  30. 21 3月, 2012 1 次提交
  31. 04 1月, 2012 1 次提交
  32. 02 11月, 2011 1 次提交
  33. 21 7月, 2011 1 次提交
    • J
      fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers · 02c24a82
      Josef Bacik 提交于
      Btrfs needs to be able to control how filemap_write_and_wait_range() is called
      in fsync to make it less of a painful operation, so push down taking i_mutex and
      the calling of filemap_write_and_wait() down into the ->fsync() handlers.  Some
      file systems can drop taking the i_mutex altogether it seems, like ext3 and
      ocfs2.  For correctness sake I just pushed everything down in all cases to make
      sure that we keep the current behavior the same for everybody, and then each
      individual fs maintainer can make up their mind about what to do from there.
      Thanks,
      Acked-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      02c24a82