1. 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
  2. 01 2月, 2014 1 次提交
  3. 26 1月, 2014 1 次提交
  4. 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
  5. 13 9月, 2013 1 次提交
  6. 12 9月, 2013 1 次提交
  7. 08 5月, 2013 1 次提交
  8. 01 5月, 2013 1 次提交
  9. 28 2月, 2013 1 次提交
  10. 23 2月, 2013 1 次提交
  11. 21 12月, 2012 1 次提交
  12. 21 9月, 2012 1 次提交
  13. 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
  14. 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
  15. 21 3月, 2012 1 次提交
  16. 04 1月, 2012 1 次提交
  17. 02 11月, 2011 1 次提交
  18. 21 7月, 2011 3 次提交
  19. 07 7月, 2011 1 次提交
  20. 10 3月, 2011 1 次提交
  21. 17 12月, 2010 2 次提交
  22. 23 11月, 2010 5 次提交
  23. 26 10月, 2010 1 次提交
  24. 14 10月, 2010 3 次提交
    • C
      hfsplus: create correct initial catalog entries for device files · 90e61690
      Christoph Hellwig 提交于
      Make sure the initial insertation of the catalog entry already contains
      the device number by calling init_special_inode early and setting writing
      out the dev field of the on-disk permission structure.  The latter is
      facilitated by sharing the almost identical hfsplus_set_perms helpers
      between initial catalog entry creating and ->write_inode.
      
      Unless we crashed just after mknod this bug was harmless as the inode
      is marked dirty at the end of hfsplus_mknod, and hfsplus_write_inode
      will update the catalog entry to contain the correct value.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      90e61690
    • C
      hfsplus: remove superflous rootflags field in hfsplus_inode_info · 722c55d1
      Christoph Hellwig 提交于
      The rootflags field in hfsplus_inode_info only caches the immutable and
      append-only flags in the VFS inode, so we can easily get rid of it.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      722c55d1
    • C
      hfsplus: fix link corruption · f6089ff8
      Christoph Hellwig 提交于
      HFS implements hardlink by using indirect catalog entries that refer to a hidden
      directly.  The link target is cached in the dev field in the HFS+ specific
      inode, which is also used for the device number for device files, and inside
      for passing the nlink value of the indirect node from hfsplus_cat_write_inode
      to a helper function.  Now if we happen to write out the indirect node while
      hfsplus_link is creating the catalog entry we'll get a link pointing to the
      linkid of the current nlink value.  This can easily be reproduced by a large
      enough loop of local git-clone operations.
      
      Stop abusing the dev field in the HFS+ inode for short term storage by
      refactoring the way the permission structure in the catalog entry is
      set up, and rename the dev field to linkid to avoid any confusion.
      
      While we're at it also prevent creating hard links to special files, as
      the HFS+ dev and linkid share the same space in the on-disk structure.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      f6089ff8
  25. 01 10月, 2010 3 次提交
    • C
      hfsplus: remove the rsrc_inodes list · 58a818f5
      Christoph Hellwig 提交于
      We never walk the list - the only reason for it is to make the resource fork
      inodes appear hashed to the writeback code.  Borrow a trick from JFS to do
      that without needing a list head.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      58a818f5
    • C
      hfsplus: fix HFSPLUS_I calling convention · 6af502de
      Christoph Hellwig 提交于
      HFSPLUS_I doesn't return a pointer to the hfsplus-specific inode
      information like all other FOO_I macros, but dereference the pointer in a way
      that made it look like a direct struct derefence.  This only works as long
      as the HFSPLUS_I macro is used directly and prevents us from keepig a local
      hfsplus_inode_info pointer.  Fix the calling convention and introduce a local
      hip variable in all functions that use it constantly.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      6af502de
    • C
      hfsplus: fix HFSPLUS_SB calling convention · dd73a01a
      Christoph Hellwig 提交于
      HFSPLUS_SB doesn't return a pointer to the hfsplus-specific superblock
      information like all other FOO_SB macros, but dereference the pointer in a way
      that made it look like a direct struct derefence.  This only works as long
      as the HFSPLUS_SB macro is used directly and prevents us from keepig a local
      hfsplus_sb_info pointer.  Fix the calling convention and introduce a local
      sbi variable in all functions that use it constantly.
      Signed-off-by: NChristoph Hellwig <hch@tuxera.com>
      dd73a01a
  26. 10 8月, 2010 4 次提交