1. 18 7月, 2012 1 次提交
  2. 28 6月, 2012 1 次提交
    • M
      GFS2: Fixing double brelse'ing bh allocated in gfs2_meta_read when EIO occurs · 44b8db13
      Masatake YAMATO 提交于
      This patch fixes buffer_head double free in following code path:
      
      gfs2_block_map
      => gfs2_meta_inode_buffer
       => gfs2_meta_indirect_buffer
        => gfs2_meta_read
      => release_metapath
      
      gfs2_block_map calls gfs2_meta_inode_buffer with &mp.mp_bh[0]
      as an argument. mp.mp_bh are filled with zero at the beginning
      of gfs2_block_map.
      
      If gfs2_meta_inode_buffer returns non-zero value, gfs2_block_map
      calls release_metapath to free buffers chained to mp.mp_bh.
      release_metapath checks each slot of mp.mp_bh[i] and
      free(with brelse) unless the slot is filled with NULL.
      
      &mp.mp_bh[0] passed to gfs2_meta_inode_buffer is filled at
      gfs2_meta_read. gfs2_meta_read is filled a buffer allocated with
      gfs2_getbuf even if EIO occurs. When EIO occurs, the allocated buffer
      is brelse'ed though the pointer(wrong poiner) points the brelse'ed is
      passed back to caller via an argument bhp.
      
      gfs2_meta_indirect_buffer, the caller also pass the wrong pointer
      to its caller with EIO. Finally gfs2_block_map gets both EIO and
      &mp.mp_bh[0] filled with the wrong pointer. release_metapath
      calls brelse again on the wrong pointer.
      Signed-off-by: NMasatake YAMATO <yamato@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      44b8db13
  3. 14 6月, 2012 1 次提交
  4. 13 6月, 2012 1 次提交
  5. 11 6月, 2012 3 次提交
  6. 08 6月, 2012 2 次提交
    • B
      GFS2: Use lvbs for storing rgrp information with mount option · 90306c41
      Benjamin Marzinski 提交于
      Instead of reading in the resource groups when gfs2 is checking
      for free space to allocate from, gfs2 can store the necessary infromation
      in the resource group's lvb.  Also, instead of searching for unlinked
      inodes in every resource group that's checked for free space, gfs2 can
      store the number of unlinked but inodes in the lvb, and only check for
      unlinked inodes if it will find some.
      
      The first time a resource group is locked, the lvb must initialized.
      Since this involves counting the unlinked inodes in the resource group,
      this takes a little extra time.  But after that, if the resource group
      is locked with GL_SKIP, the buffer head won't be read in unless it's
      actually needed.
      
      Enabling the resource groups lvbs is done via the rgrplvb mount option.  If
      this option isn't set, the lvbs will still be set and updated, but they won't
      be verfied or used by the filesystem.  To safely turn on this option, all of
      the nodes mounting the filesystem must be running code with this patch, and
      the filesystem must have been completely unmounted since they were updated.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      90306c41
    • S
      GFS2: Cache last hash bucket for glock seq_files · ba1ddcb6
      Steven Whitehouse 提交于
      For the glocks and glstats seq_files, which are exposed via debugfs
      we should cache the most recent hash bucket, along with the offset
      into that bucket. This allows us to restart from that point, rather
      than having to begin at the beginning each time.
      
      This is an idea from Eric Dumazet, however I've slightly extended it
      so that if the position from which we are due to start is at any
      point beyond the last cached point, we start from the last cached
      point, plus whatever is the appropriate offset. I don't really expect
      people to be lseeking around these files, but if they did so with only
      positive offsets, then we'd still get some of the benefit of using a
      cached offset.
      
      With my simple test of around 200k entries in the file, I'm seeing
      an approx 10x speed up.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ba1ddcb6
  7. 07 6月, 2012 1 次提交
  8. 06 6月, 2012 4 次提交
  9. 05 6月, 2012 1 次提交
    • L
      vfs: Fix /proc/<tid>/fdinfo/<fd> file handling · 0640113b
      Linus Torvalds 提交于
      Cyrill Gorcunov reports that I broke the fdinfo files with commit
      30a08bf2 ("proc: move fd symlink i_mode calculations into
      tid_fd_revalidate()"), and he's quite right.
      
      The tid_fd_revalidate() function is not just used for the <tid>/fd
      symlinks, it's also used for the <tid>/fdinfo/<fd> files, and the
      permission model for those are different.
      
      So do the dynamic symlink permission handling just for symlinks, making
      the fdinfo files once more appear as the proper regular files they are.
      
      Of course, Al Viro argued (probably correctly) that we shouldn't do the
      symlink permission games at all, and make the symlinks always just be
      the normal 'lrwxrwxrwx'.  That would have avoided this issue too, but
      since somebody noticed that the permissions had changed (which was the
      reason for that original commit 30a08bf2 in the first place), people
      do apparently use this feature.
      
      [ Basically, you can use the symlink permission data as a cheap "fdinfo"
        replacement, since you see whether the file is open for reading and/or
        writing by just looking at st_mode of the symlink.  So the feature
        does make sense, even if the pain it has caused means we probably
        shouldn't have done it to begin with. ]
      Reported-and-tested-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0640113b
  10. 02 6月, 2012 25 次提交