1. 07 11月, 2012 12 次提交
    • S
      GFS2: Use proper allocation context for new inodes · c9aecf73
      Steven Whitehouse 提交于
      Rather than using the parent directory's allocation context, this
      patch allocated the new inode earlier in the process and then uses
      it to contain all the information required. As a result, we can now
      use the new inode's own allocation context to allocate it rather
      than having to use the parent directory's context. This give us a
      lot more flexibility in where the inode is placed on disk.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c9aecf73
    • S
      GFS2: Add test for resource group congestion status · bcd97c06
      Steven Whitehouse 提交于
      This patch uses information gathered by the recent glock statistics
      patch in order to derrive a boolean verdict on the congestion
      status of a resource group. This is then used when making decisions
      on which resource group to choose during block allocation.
      
      The aim is to avoid resource groups which are heavily contended
      by other nodes, while still ensuring locality of access wherever
      possible.
      
      Once a reservation has been made in a particular resource group
      we continue to use that resource group until a new reservation is
      required. This should help to ensure that we do not change resource
      groups too often.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      bcd97c06
    • B
      GFS2: Rename glops go_xmote_th to go_sync · 06dfc306
      Bob Peterson 提交于
      [Editorial: This is a nit, but has been a minor irritation for a long time:]
      
      This patch renames glops structure item for go_xmote_th to go_sync.
      The functionality is unchanged; it's just for readability.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      06dfc306
    • B
      GFS2: Speed up gfs2_rbm_from_block · a68a0a35
      Bob Peterson 提交于
      This patch is a rewrite of function gfs2_rbm_from_block. Rather than
      looping to find the right bitmap, the code now does a few simple
      math calculations.
      
      I compared the performance of both algorithms side by side and the new
      algorithm is noticeably faster. Sample instrumentation output from a
      "fast" machine:
      
      5 million calls: millisec spent: Orig: 166 New: 113
      5 million calls: millisec spent: Orig: 189 New: 114
      
      In addition, I ran postmark (on a somewhat slowr CPU) before the after
      the new algorithm was put in place and postmark showed a decent
      improvement:
      
      Before the new algorithm:
      -------------------------
      Time:
      	645 seconds total
      	584 seconds of transactions (171 per second)
      
      Files:
      	150087 created (232 per second)
      		Creation alone: 100000 files (2083 per second)
      		Mixed with transactions: 50087 files (85 per second)
      	49995 read (85 per second)
      	49991 appended (85 per second)
      	150087 deleted (232 per second)
      		Deletion alone: 100174 files (7705 per second)
      		Mixed with transactions: 49913 files (85 per second)
      
      Data:
      	273.42 megabytes read (434.08 kilobytes per second)
      	852.13 megabytes written (1.32 megabytes per second)
      
      With the new algorithm:
      -----------------------
      Time:
      	599 seconds total
      	530 seconds of transactions (188 per second)
      
      Files:
      	150087 created (250 per second)
      		Creation alone: 100000 files (1886 per second)
      		Mixed with transactions: 50087 files (94 per second)
      	49995 read (94 per second)
      	49991 appended (94 per second)
      	150087 deleted (250 per second)
      		Deletion alone: 100174 files (6260 per second)
      		Mixed with transactions: 49913 files (94 per second)
      
      Data:
      	273.42 megabytes read (467.42 kilobytes per second)
      	852.13 megabytes written (1.42 megabytes per second)
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      a68a0a35
    • S
      GFS2: Review bug traps in glops.c · 8eae1ca0
      Steven Whitehouse 提交于
      Two of the bug traps here could really be warnings. The others are
      converted from BUG() to GLOCK_BUG_ON() since we'll most likely
      need to know the glock state in order to debug any issues which
      arise. As a result of this, __dump_glock has to be renamed and
      is no longer static.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8eae1ca0
    • B
      GFS2: Test bufdata with buffer locked and gfs2_log_lock held · 96e5d1d3
      Benjamin Marzinski 提交于
      In gfs2_trans_add_bh(), gfs2 was testing if a there was a bd attached to the
      buffer without having the gfs2_log_lock held. It was then assuming it would
      stay attached for the rest of the function. However, without either the log
      lock being held of the buffer locked, __gfs2_ail_flush() could detach bd at any
      time.  This patch moves the locking before the test.  If there isn't a bd
      already attached, gfs2 can safely allocate one and attach it before locking.
      There is no way that the newly allocated bd could be on the ail list,
      and thus no way for __gfs2_ail_flush() to detach it.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      96e5d1d3
    • B
      GFS2: Don't call file_accessed() with a shared glock · 3d162688
      Benjamin Marzinski 提交于
      file_accessed() was being called by gfs2_mmap() with a shared glock. If it
      needed to update the atime, it was crashing because it dirtied the inode in
      gfs2_dirty_inode() without holding an exclusive lock. gfs2_dirty_inode()
      checked if the caller was already holding a glock, but it didn't make sure that
      the glock was in the exclusive state. Now, instead of calling file_accessed()
      while holding the shared lock in gfs2_mmap(), file_accessed() is called after
      grabbing and releasing the glock to update the inode.  If file_accessed() needs
      to update the atime, it will grab an exclusive lock in gfs2_dirty_inode().
      
      gfs2_dirty_inode() now also checks to make sure that if the calling process has
      already locked the glock, it has an exclusive lock.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3d162688
    • L
      GFS2: Fix FITRIM argument handling · 076f0faa
      Lukas Czerner 提交于
      Currently implementation in gfs2 uses FITRIM arguments as it were in
      file system blocks units which is wrong. The FITRIM arguments
      (fstrim_range.start, fstrim_range.len and fstrim_range.minlen) are
      actually in bytes.
      
      Moreover, check for start argument beyond the end of file system, len
      argument being smaller than file system block and minlen argument being
      bigger than biggest resource group were missing.
      
      This commit converts the code to convert FITRIM argument to file system
      blocks and also adds appropriate checks mentioned above.
      
      All the problems were recognised by xfstests 251 and 260.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      076f0faa
    • L
      GFS2: Require user to provide argument for FITRIM · 3a238ade
      Lukas Czerner 提交于
      When the fstrim_range argument is not provided by user in FITRIM ioctl
      we should just return EFAULT and not promoting bad behaviour by filling
      the structure in kernel. Let the user deal with it.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3a238ade
    • A
      GFS2: Clean up some unused assignments · 73738a77
      Andrew Price 提交于
      Cleans up two cases where variables were assigned values but then never
      used again.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      73738a77
    • A
      GFS2: Fix possible null pointer deref in gfs2_rs_alloc · cd0ed19f
      Andrew Price 提交于
      Despite the return value from kmem_cache_zalloc() being checked, the
      error wasn't being returned until after a possible null pointer
      dereference. This patch returns the error immediately, allowing the
      removal of the error variable.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      cd0ed19f
    • A
      GFS2: Fix an unchecked error from gfs2_rs_alloc · aaaf68c5
      Andrew Price 提交于
      Check the return value of gfs2_rs_alloc(ip) and avoid a possible null
      pointer dereference.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      aaaf68c5
  2. 10 10月, 2012 1 次提交
    • H
      tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking · 35c2a7f4
      Hugh Dickins 提交于
      Fuzzing with trinity oopsed on the 1st instruction of shmem_fh_to_dentry(),
      	u64 inum = fid->raw[2];
      which is unhelpfully reported as at the end of shmem_alloc_inode():
      
      BUG: unable to handle kernel paging request at ffff880061cd3000
      IP: [<ffffffff812190d0>] shmem_alloc_inode+0x40/0x40
      Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      Call Trace:
       [<ffffffff81488649>] ? exportfs_decode_fh+0x79/0x2d0
       [<ffffffff812d77c3>] do_handle_open+0x163/0x2c0
       [<ffffffff812d792c>] sys_open_by_handle_at+0xc/0x10
       [<ffffffff83a5f3f8>] tracesys+0xe1/0xe6
      
      Right, tmpfs is being stupid to access fid->raw[2] before validating that
      fh_len includes it: the buffer kmalloc'ed by do_sys_name_to_handle() may
      fall at the end of a page, and the next page not be present.
      
      But some other filesystems (ceph, gfs2, isofs, reiserfs, xfs) are being
      careless about fh_len too, in fh_to_dentry() and/or fh_to_parent(), and
      could oops in the same way: add the missing fh_len checks to those.
      Reported-by: NSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Sage Weil <sage@inktank.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      35c2a7f4
  3. 09 10月, 2012 1 次提交
    • K
      mm: kill vma flag VM_CAN_NONLINEAR · 0b173bc4
      Konstantin Khlebnikov 提交于
      Move actual pte filling for non-linear file mappings into the new special
      vma operation: ->remap_pages().
      
      Filesystems must implement this method to get non-linear mapping support,
      if it uses filemap_fault() then generic_file_remap_pages() can be used.
      
      Now device drivers can implement this method and obtain nonlinear vma support.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>	#arch/tile
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Morris <james.l.morris@oracle.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Venkatesh Pallipadi <venki@google.com>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0b173bc4
  4. 24 9月, 2012 26 次提交