1. 04 1月, 2012 4 次提交
  2. 02 12月, 2011 1 次提交
    • A
      ocfs2: avoid unaligned access to dqc_bitmap · 93925579
      Akinobu Mita 提交于
      The dqc_bitmap field of struct ocfs2_local_disk_chunk is 32-bit aligned,
      but not 64-bit aligned.  The dqc_bitmap is accessed by ocfs2_set_bit(),
      ocfs2_clear_bit(), ocfs2_test_bit(), or ocfs2_find_next_zero_bit().  These
      are wrapper macros for ext2_*_bit() which need to take an unsigned long
      aligned address (though some architectures are able to handle unaligned
      address correctly)
      
      So some 64bit architectures may not be able to access the dqc_bitmap
      correctly.
      
      This avoids such unaligned access by using another wrapper functions for
      ext2_*_bit().  The code is taken from fs/ext4/mballoc.c which also need to
      handle unaligned bitmap access.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Acked-by: NJoel Becker <jlbec@evilplan.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJoel Becker <jlbec@evilplan.org>
      93925579
  3. 17 11月, 2011 7 次提交
  4. 02 11月, 2011 3 次提交
  5. 01 11月, 2011 2 次提交
  6. 01 8月, 2011 2 次提交
  7. 28 7月, 2011 2 次提交
    • J
      ocfs2: Avoid livelock in ocfs2_readpage() · c7e25e6e
      Jan Kara 提交于
      When someone writes to an inode, readers accessing the same inode via
      ocfs2_readpage() just busyloop trying to get ip_alloc_sem because
      do_generic_file_read() looks up the page again and retries ->readpage()
      when previous attempt failed with AOP_TRUNCATED_PAGE. When there are enough
      readers, they can occupy all CPUs and in non-preempt kernel the system is
      deadlocked because writer holding ip_alloc_sem is never run to release the
      semaphore. Fix the problem by making reader block on ip_alloc_sem to break
      the busy loop.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJoel Becker <jlbec@evilplan.org>
      c7e25e6e
    • M
      ocfs2: serialize unaligned aio · a11f7e63
      Mark Fasheh 提交于
      Fix a corruption that can happen when we have (two or more) outstanding
      aio's to an overlapping unaligned region.  Ext4
      (e9e3bcec) and xfs recently had to fix
      similar issues.
      
      In our case what happens is that we can have an outstanding aio on a region
      and if a write comes in with some bytes overlapping the original aio we may
      decide to read that region into a page before continuing (typically because
      of buffered-io fallback).  Since we have no ordering guarantees with the
      aio, we can read stale or bad data into the page and then write it back out.
      
      If the i/o is page and block aligned, then we avoid this issue as there
      won't be any need to read data from disk.
      
      I took the same approach as Eric in the ext4 patch and introduced some
      serialization of unaligned async direct i/o.  I don't expect this to have an
      effect on the most common cases of AIO.  Unaligned aio will be slower
      though, but that's far more acceptable than data corruption.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      Signed-off-by: NJoel Becker <jlbec@evilplan.org>
      a11f7e63
  8. 26 7月, 2011 5 次提交
    • S
      ocfs2: Implement llseek() · 93862d5e
      Sunil Mushran 提交于
      ocfs2 implements its own llseek() to provide the SEEK_HOLE/SEEK_DATA
      functionality.
      
      SEEK_HOLE sets the file pointer to the start of either a hole or an unwritten
      (preallocated) extent, that is greater than or equal to the supplied offset.
      
      SEEK_DATA sets the file pointer to the start of an allocated extent (not
      unwritten) that is greater than or equal to the supplied offset.
      
      If the supplied offset is on a desired region, then the file pointer is set
      to it. Offsets greater than or equal to the file size return -ENXIO.
      
      Unwritten (preallocated) extents are considered holes because the file system
      treats reads to such regions in the same way as it does to holes.
      Signed-off-by: NSunil Mushran <sunil.mushran@oracle.com>
      93862d5e
    • C
      fs: take the ACL checks to common code · 4e34e719
      Christoph Hellwig 提交于
      Replace the ->check_acl method with a ->get_acl method that simply reads an
      ACL from disk after having a cache miss.  This means we can replace the ACL
      checking boilerplate code with a single implementation in namei.c.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4e34e719
    • A
      kill boilerplates around posix_acl_create_masq() · 826cae2f
      Al Viro 提交于
      new helper: posix_acl_create(&acl, gfp, mode_p).  Replaces acl with
      modified clone, on failure releases acl and replaces with NULL.
      Returns 0 or -ve on error.  All callers of posix_acl_create_masq()
      switched.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      826cae2f
    • A
      kill boilerplate around posix_acl_chmod_masq() · bc26ab5f
      Al Viro 提交于
      new helper: posix_acl_chmod(&acl, gfp, mode).  Replaces acl with modified
      clone or with NULL if that has failed; returns 0 or -ve on error.  All
      callers of posix_acl_chmod_masq() switched to that - they'd been doing
      exactly the same thing.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bc26ab5f
    • L
      vfs: move ACL cache lookup into generic code · e77819e5
      Linus Torvalds 提交于
      This moves logic for checking the cached ACL values from low-level
      filesystems into generic code.  The end result is a streamlined ACL
      check that doesn't need to load the inode->i_op->check_acl pointer at
      all for the common cached case.
      
      The filesystems also don't need to check for a non-blocking RCU walk
      case in their acl_check() functions, because that is all handled at a
      VFS layer.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e77819e5
  9. 25 7月, 2011 14 次提交