1. 05 9月, 2014 2 次提交
    • 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
  2. 04 9月, 2014 3 次提交
  3. 07 5月, 2014 3 次提交
  4. 04 4月, 2014 1 次提交
    • J
      mm + fs: store shadow entries in page cache · 91b0abe3
      Johannes Weiner 提交于
      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: NJohannes Weiner <hannes@cmpxchg.org>
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Reviewed-by: NMinchan Kim <minchan@kernel.org>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Metin Doslu <metin@citusdata.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Ozgun Erdogan <ozgun@citusdata.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Roman Gushchin <klamm@yandex-team.ru>
      Cc: Ryan Mallon <rmallon@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      91b0abe3
  5. 21 2月, 2014 1 次提交
    • J
      udf: Fix data corruption on file type conversion · 09ebb17a
      Jan Kara 提交于
      UDF has two types of files - files with data stored in inode (ICB in
      UDF terminology) and files with data stored in external data blocks. We
      convert file from in-inode format to external format in
      udf_file_aio_write() when we find out data won't fit into inode any
      longer. However the following race between two O_APPEND writes can happen:
      
      CPU1					CPU2
      udf_file_aio_write()			udf_file_aio_write()
        down_write(&iinfo->i_data_sem);
        checks that i_size + count1 fits within inode
          => no need to convert
        up_write(&iinfo->i_data_sem);
      					  down_write(&iinfo->i_data_sem);
      					  checks that i_size + count2 fits
      					    within inode => no need to convert
      					  up_write(&iinfo->i_data_sem);
        generic_file_aio_write()
          - extends file by count1 bytes
      					  generic_file_aio_write()
      					    - extends file by count2 bytes
      
      Clearly if count1 + count2 doesn't fit into the inode, we overwrite
      kernel buffers beyond inode, possibly corrupting the filesystem as well.
      
      Fix the problem by acquiring i_mutex before checking whether write fits
      into the inode and using __generic_file_aio_write() afterwards which
      puts check and write into one critical section.
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      09ebb17a
  6. 13 9月, 2013 1 次提交
  7. 08 5月, 2013 1 次提交
  8. 22 1月, 2013 1 次提交
    • N
      udf: add extent cache support in case of file reading · 99600051
      Namjae Jeon 提交于
      This patch implements extent caching in case of file reading.
      While reading a file, currently, UDF reads metadata serially
      which takes a lot of time depending on the number of extents present
      in the file. Caching last accessd extent improves metadata read time.
      Instead of reading file metadata from start, now we read from
      the cached extent.
      
      This patch considerably improves the time spent by CPU in kernel mode.
      For example, while reading a 10.9 GB file using dd:
      Time before applying patch:
      11677022208 bytes (10.9GB) copied, 1529.748921 seconds, 7.3MB/s
      real    25m 29.85s
      user    0m 12.41s
      sys     15m 34.75s
      
      Time after applying patch:
      11677022208 bytes (10.9GB) copied, 1469.338231 seconds, 7.6MB/s
      real    24m 29.44s
      user    0m 15.73s
      sys     3m 27.61s
      
      [JK: Fix bh refcounting issues, simplify initialization]
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NAshish Sangwan <a.sangwan@samsung.com>
      Signed-off-by: NBonggil Bak <bgbak@samsung.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      99600051
  9. 13 12月, 2012 3 次提交
  10. 21 9月, 2012 1 次提交
  11. 06 9月, 2012 1 次提交
    • I
      UDF: Add support for O_DIRECT · 5eec54fc
      Ian Abbott 提交于
      Add support for the O_DIRECT flag.  There are two cases to deal with:
      
      1. Small files stored in the ICB (inode control block?): just return 0
      from the new udf_adinicb_direct_IO() handler to fall back to buffered
      I/O.
      
      2. Larger files, not stored in the ICB: nothing special here.  Just call
      blockdev_direct_IO() from our new udf_direct_IO() handler and tidy up
      any blocks instantiated outside i_size on error.  This is pretty
      standard.  Factor error handling code out of udf_write_begin() into new
      function udf_write_failed() so it can also be called by udf_direct_IO().
      
      Also change the whitespace in udf_aops to make it a bit neater.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5eec54fc
  12. 04 9月, 2012 1 次提交
    • N
      udf: add writepages support for udf · 378b8e1a
      Namjae Jeon 提交于
      Use mpage_writepages() instead of multiple calls to udf_writepage()
      to make performance higher.
      
      *Write Speed with writepage() =
       RecSize     ReadSpeed    WriteSpeed  RanReadSpeed RanWriteSpeed
      10485760    0.00MB/sec    8.56MB/sec    0.00MB/sec    8.20MB/sec
       1048576    0.00MB/sec    8.57MB/sec    0.00MB/sec    6.42MB/sec
        524288    0.00MB/sec    8.59MB/sec    0.00MB/sec    5.24MB/sec
        262144    0.00MB/sec    8.59MB/sec    0.00MB/sec    4.17MB/sec
        131072    0.00MB/sec    8.53MB/sec    0.00MB/sec    3.32MB/sec
         65536    0.00MB/sec    8.49MB/sec    0.00MB/sec    2.31MB/sec
      
      *Write Speed with writepages()
      RecSize     ReadSpeed    WriteSpeed  RanReadSpeed RanWriteSpeed
      10485760    0.00MB/sec    9.88MB/sec    0.00MB/sec    9.60MB/sec
       1048576    0.00MB/sec    9.95MB/sec    0.00MB/sec    7.52MB/sec
        524288    0.00MB/sec    9.98MB/sec    0.00MB/sec    6.16MB/sec
        262144    0.00MB/sec    9.90MB/sec    0.00MB/sec    4.98MB/sec
        131072    0.00MB/sec    9.89MB/sec    0.00MB/sec    3.78MB/sec
         65536    0.00MB/sec    9.81MB/sec    0.00MB/sec    2.50MB/sec
      
      There is about 1.4MB/sec speed improvement over 8.5MB/sec,
      which comes out around 16% improvement.
      Signed-off-by: NNamjae Jeon <linkinjeon@gmail.com>
      Signed-off-by: NAshish Sangwan <ashish.sangwan2@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      378b8e1a
  13. 15 8月, 2012 1 次提交
  14. 09 7月, 2012 1 次提交
  15. 06 5月, 2012 1 次提交
  16. 01 3月, 2012 2 次提交
  17. 09 1月, 2012 2 次提交
  18. 04 1月, 2012 1 次提交
    • A
      udf: propagate umode_t · faa17292
      Al Viro 提交于
      note re mount options: fmask and dmask are explicitly truncated to 12bit,
      UDF_INVALID_MODE just needs to be guaranteed to differ from any such value.
      And umask is used only in &= with umode_t, so we ignore other bits anyway.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      faa17292
  19. 02 11月, 2011 1 次提交
  20. 01 11月, 2011 2 次提交
  21. 06 10月, 2011 1 次提交
  22. 10 3月, 2011 1 次提交
  23. 23 2月, 2011 1 次提交
  24. 07 1月, 2011 4 次提交
    • A
      udf: Remove unnecessary bkl usages · 9db9f9e3
      Alessio Igor Bogani 提交于
      The udf_readdir(), udf_lookup(), udf_create(), udf_mknod(), udf_mkdir(),
      udf_rmdir(), udf_link(), udf_get_parent() and udf_unlink() seems already
      adequately protected by i_mutex held by VFS invoking calls. The udf_rename()
      instead should be already protected by lock_rename again by VFS. The
      udf_ioctl(), udf_fill_super() and udf_evict_inode() don't requires any further
      protection.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      Signed-off-by: NAlessio Igor Bogani <abogani@texware.it>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9db9f9e3
    • A
      udf: Replace bkl with the UDF_I(inode)->i_data_sem for protect udf_inode_info struct · 4d0fb621
      Alessio Igor Bogani 提交于
      Replace bkl with the UDF_I(inode)->i_data_sem rw semaphore in
      udf_release_file(), udf_symlink(), udf_symlink_filler(), udf_get_block(),
      udf_block_map(), and udf_setattr(). The rule now is that any operation
      on regular file's or symlink's extents (or generally allocation information
      including goal block) needs to hold i_data_sem.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      Signed-off-by: NAlessio Igor Bogani <abogani@texware.it>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4d0fb621
    • J
      udf: Protect default inode credentials by rwlock · c03cad24
      Jan Kara 提交于
      Superblock carries credentials (uid, gid, etc.) which are used as default
      values in __udf_read_inode() when media does not provide these. These
      credentials can change during remount so we protect them by a rwlock so that
      each inode gets a consistent set of credentials.
      Signed-off-by: NJan Kara <jack@suse.cz>
      c03cad24
    • J
      udf: Remove BKL from udf_update_inode · 49521de1
      Jan Kara 提交于
      udf_update_inode() does not need BKL since on-disk inode modifications are
      protected by the buffer lock and reading of values of in-memory inode is
      safe without any lock. In some cases we can write inconsistent inode state
      to disk but in that case inode will be marked dirty and overwritten later.
      
      Also make unnecessarily global udf_sync_inode() static.
      Signed-off-by: NJan Kara <jack@suse.cz>
      49521de1
  25. 10 8月, 2010 2 次提交
  26. 24 5月, 2010 1 次提交
    • J
      udf: Remove dead quota code · 36350462
      Jan Kara 提交于
      Quota on UDF is non-functional at least since 2.6.16 (I'm too lazy to
      do more archeology) because it does not provide .quota_write and .quota_read
      functions and thus quotaon(8) just returns EINVAL. Since nobody complained
      for all those years and quota support is not even in UDF standard just nuke
      it.
      Signed-off-by: NJan Kara <jack@suse.cz>
      36350462