1. 10 1月, 2017 7 次提交
  2. 05 1月, 2017 1 次提交
    • J
      udf: Make stat on symlink report symlink length as st_size · ad4d0532
      Jan Kara 提交于
      UDF encodes symlinks in a more complex fashion and thus i_size of a
      symlink does not match the lenght of a string returned by readlink(2).
      This confuses some applications (see bug 191241) and may be considered a
      violation of POSIX. Fix the problem by reading the link into page cache
      in response to stat(2) call and report the length of the decoded path.
      Signed-off-by: NJan Kara <jack@suse.cz>
      ad4d0532
  3. 03 1月, 2017 1 次提交
  4. 01 11月, 2016 1 次提交
  5. 28 9月, 2016 1 次提交
  6. 08 6月, 2016 1 次提交
  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. 04 1月, 2016 1 次提交
    • A
      udf: avoid uninitialized variable use · 4f1b1519
      Arnd Bergmann 提交于
      A new warning has come up from a recent cleanup:
      
      fs/udf/inode.c: In function 'udf_setup_indirect_aext':
      fs/udf/inode.c:1927:28: warning: 'adsize' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      If the alloc_type is neither ICBTAG_FLAG_AD_SHORT nor
      ICBTAG_FLAG_AD_LONG, the value of adsize is undefined. Currently,
      callers of these functions make sure alloc_type is one of the two valid
      ones but for future proofing make sure we handle the case of invalid
      alloc type as well.  This changes the code to return -EIOin that case.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: fcea62ba ("udf: Factor out code for creating indirect extent")
      Signed-off-by: NJan Kara <jack@suse.cz>
      4f1b1519
  11. 24 12月, 2015 2 次提交
    • J
      udf: Fix lost indirect extent block · 6c371578
      Jan Kara 提交于
      When inode ends with empty indirect extent block and we extended that
      file, udf_do_extend_file() ended up just overwriting pointer to it with
      another extent and thus effectively leaking the block and also
      corruptiong length of allocation descriptors.
      
      Fix the problem by properly following into next indirect extent when it
      is present.
      Signed-off-by: NJan Kara <jack@suse.cz>
      6c371578
    • J
      udf: Factor out code for creating indirect extent · fcea62ba
      Jan Kara 提交于
      Factor out code for creating indirect extent from udf_add_aext(). It was
      mostly duplicated in two places. Also remove some opencoded versions
      of udf_write_aext().
      Signed-off-by: NJan Kara <jack@suse.cz>
      fcea62ba
  12. 23 12月, 2015 1 次提交
  13. 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
  14. 07 12月, 2015 1 次提交
  15. 09 7月, 2015 1 次提交
    • S
      udf: Don't corrupt unalloc spacetable when writing it · 70f19f58
      Steven J. Magnani 提交于
      For a UDF filesystem configured with an Unallocated Space Table,
      a filesystem operation that triggers an update to the table results
      in on-disk corruption that prevents remounting:
      
        udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 274
      
      For example:
        1. Create a filesystem
            $ mkudffs --media-type=hd --blocksize=512 --lvid=BUGTEST \
                    --vid=BUGTEST --fsid=BUGTEST --space=unalloctable \
                    /dev/mmcblk0
      
        2. Mount it
            # mount /dev/mmcblk0 /mnt
      
        3. Create a file
            $ echo "No corruption, please" > /mnt/new.file
      
        4. Umount
            # umount /mnt
      
        5. Attempt remount
            # mount /dev/mmcblk0 /mnt
      
      This appears to be a longstanding bug caused by zero-initialization of
      the Unallocated Space Entry block buffer and only partial repopulation
      of required fields before writing to disk.
      
      Commit 0adfb339fd64 ("udf: Fix unalloc space handling in udf_update_inode")
      addressed one such field, but several others are required.
      Signed-off-by: NSteven J. Magnani <steve@digidescorp.com>
      Signed-off-by: NJan Kara <jack@suse.com>
      70f19f58
  16. 12 4月, 2015 3 次提交
  17. 01 4月, 2015 1 次提交
  18. 26 3月, 2015 1 次提交
  19. 14 3月, 2015 1 次提交
  20. 05 2月, 2015 1 次提交
  21. 07 1月, 2015 2 次提交
  22. 19 12月, 2014 1 次提交
  23. 09 10月, 2014 1 次提交
    • J
      udf: Fix loading of special inodes · 6174c2eb
      Jan Kara 提交于
      Some UDF media have special inodes (like VAT or metadata partition
      inodes) whose link_count is 0. Thus commit 4071b913 (udf: Properly
      detect stale inodes) broke loading these inodes because udf_iget()
      started returning -ESTALE for them. Since we still need to properly
      detect stale inodes queried by NFS, create two variants of udf_iget() -
      one which is used for looking up special inodes (which ignores
      link_count == 0) and one which is used for other cases which return
      ESTALE when link_count == 0.
      
      Fixes: 4071b913
      CC: stable@vger.kernel.org
      Signed-off-by: NJan Kara <jack@suse.cz>
      6174c2eb
  24. 05 9月, 2014 3 次提交
    • J
      udf: Set i_generation field · 470cca56
      Jan Kara 提交于
      Currently UDF doesn't initialize i_generation in any way and thus NFS
      can easily get reallocated inodes from stale file handles. Luckily UDF
      already has a unique object identifier associated with each inode -
      i_unique. Use that for initialization of i_generation.
      Signed-off-by: NJan Kara <jack@suse.cz>
      470cca56
    • J
      udf: Properly detect stale inodes · 4071b913
      Jan Kara 提交于
      NFS can easily ask for inodes that are already deleted. Currently UDF
      happily returns such inodes which is a bug. Return -ESTALE if
      udf_read_inode() is asked to read deleted inode.
      Signed-off-by: NJan Kara <jack@suse.cz>
      4071b913
    • J
      udf: Make udf_read_inode() and udf_iget() return error · 6d3d5e86
      Jan Kara 提交于
      Currently __udf_read_inode() wasn't returning anything and we found out
      whether we succeeded reading inode by checking whether inode is bad or
      not. udf_iget() returned NULL on failure and inode pointer otherwise.
      Make these two functions properly propagate errors up the call stack and
      use the return value in callers.
      Signed-off-by: NJan Kara <jack@suse.cz>
      6d3d5e86
  25. 04 9月, 2014 3 次提交
  26. 07 5月, 2014 1 次提交