1. 02 11月, 2010 2 次提交
  2. 31 10月, 2010 1 次提交
  3. 30 10月, 2010 18 次提交
  4. 29 10月, 2010 19 次提交
    • T
      eCryptfs: Print mount_auth_tok_only param in ecryptfs_show_options · 8747f954
      Tyler Hicks 提交于
      When printing mount options, print the new ecryptfs_mount_auth_tok_only
      mount option.
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      8747f954
    • R
      ecryptfs: added ecryptfs_mount_auth_tok_only mount parameter · f16feb51
      Roberto Sassu 提交于
      This patch adds a new mount parameter 'ecryptfs_mount_auth_tok_only' to
      force ecryptfs to use only authentication tokens which signature has
      been specified at mount time with parameters 'ecryptfs_sig' and
      'ecryptfs_fnek_sig'. In this way, after disabling the passthrough and
      the encrypted view modes, it's possible to make available to users only
      files encrypted with the specified authentication token.
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      Cc: Dustin Kirkland <kirkland@canonical.com>
      Cc: James Morris <jmorris@namei.org>
      [Tyler: Clean up coding style errors found by checkpatch]
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      f16feb51
    • R
      ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig() · 39fac853
      Roberto Sassu 提交于
      This patch replaces the check of the 'matching_auth_tok' pointer with
      the exit status of ecryptfs_find_auth_tok_for_sig().
      This avoids to use authentication tokens obtained through the function
      ecryptfs_keyring_auth_tok_for_sig which are not valid.
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      Cc: Dustin Kirkland <kirkland@canonical.com>
      Cc: James Morris <jmorris@namei.org>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      39fac853
    • R
      ecryptfs: release keys loaded in ecryptfs_keyring_auth_tok_for_sig() · aee683b9
      Roberto Sassu 提交于
      This patch allows keys requested in the function
      ecryptfs_keyring_auth_tok_for_sig()to be released when they are no
      longer required. In particular keys are directly released in the same
      function if the obtained authentication token is not valid.
      
      Further, a new function parameter 'auth_tok_key' has been added to
      ecryptfs_find_auth_tok_for_sig() in order to provide callers the key
      pointer to be passed to key_put().
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      Cc: Dustin Kirkland <kirkland@canonical.com>
      Cc: James Morris <jmorris@namei.org>
      [Tyler: Initialize auth_tok_key to NULL in ecryptfs_parse_packet_set]
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      aee683b9
    • T
      eCryptfs: Clear LOOKUP_OPEN flag when creating lower file · 2e21b3f1
      Tyler Hicks 提交于
      eCryptfs was passing the LOOKUP_OPEN flag through to the lower file
      system, even though ecryptfs_create() doesn't support the flag. A valid
      filp for the lower filesystem could be returned in the nameidata if the
      lower file system's create() function supported LOOKUP_OPEN, possibly
      resulting in unencrypted writes to the lower file.
      
      However, this is only a potential problem in filesystems (FUSE, NFS,
      CIFS, CEPH, 9p) that eCryptfs isn't known to support today.
      
      https://bugs.launchpad.net/ecryptfs/+bug/641703
      
      Reported-by: Kevin Buhr
      Cc: stable <stable@kernel.org>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      2e21b3f1
    • R
      ecryptfs: call vfs_setxattr() in ecryptfs_setxattr() · 48b512e6
      Roberto Sassu 提交于
      Ecryptfs is a stackable filesystem which relies on lower filesystems the
      ability of setting/getting extended attributes.
      
      If there is a security module enabled on the system it updates the
      'security' field of inodes according to the owned extended attribute set
      with the function vfs_setxattr().  When this function is performed on a
      ecryptfs filesystem the 'security' field is not updated for the lower
      filesystem since the call security_inode_post_setxattr() is missing for
      the lower inode.
      Further, the call security_inode_setxattr() is missing for the lower inode,
      leading to policy violations in the security module because specific
      checks for this hook are not performed (i. e. filesystem
      'associate' permission on SELinux is not checked for the lower filesystem).
      
      This patch replaces the call of the setxattr() method of the lower inode
      in the function ecryptfs_setxattr() with vfs_setxattr().
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      Cc: stable <stable@kernel.org>
      Cc: Dustin Kirkland <kirkland@canonical.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      48b512e6
    • C
      Btrfs: fix raid code for removing missing drives · 18e503d6
      Chris Mason 提交于
      When btrfs is mounted in degraded mode, it has some internal structures
      to track the missing devices.  This missing device is setup as readonly,
      but the mapping code can get upset when we try to write to it.
      
      This changes the mapping code to return -EIO instead of oops when we try
      to write to the readonly device.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      18e503d6
    • M
      Btrfs: Switch the extent buffer rbtree into a radix tree · 19fe0a8b
      Miao Xie 提交于
      This patch reduces the CPU time spent in the extent buffer search by using the
      radix tree instead of the rbtree and using the rcu lock instead of the spin
      lock.
      
      I did a quick test by the benchmark tool[1] and found the patch improve the
      file creation/deletion performance problem that I have reported[2].
      
      Before applying this patch:
      Create files:
      	Total files: 50000
      	Total time: 0.971531
      	Average time: 0.000019
      Delete files:
      	Total files: 50000
      	Total time: 1.366761
      	Average time: 0.000027
      
      After applying this patch:
      Create files:
      	Total files: 50000
      	Total time: 0.927455
      	Average time: 0.000019
      Delete files:
      	Total files: 50000
      	Total time: 1.292280
      	Average time: 0.000026
      
      [1] http://marc.info/?l=linux-btrfs&m=128212635122920&q=p3
      [2] http://marc.info/?l=linux-btrfs&m=128212635122920&w=2Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      19fe0a8b
    • M
      Btrfs: restructure try_release_extent_buffer() · 897ca6e9
      Miao Xie 提交于
      restructure try_release_extent_buffer() and write a function to release the
      extent buffer. It will be used later.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      897ca6e9
    • C
      Btrfs: use the flusher threads for delalloc throttling · bf9022e0
      Chris Mason 提交于
      We have a fairly complex set of loops around walking our list of
      delalloc inodes when we find metadata delalloc space running low.
      It doesn't work very well, can use large amounts of CPU and doesn't
      do very efficient writeback.
      
      This switches us to kick the bdi flusher threads instead.  All dirty
      data in btrfs is accounted as delalloc data, so this is very similar
      in terms of what it writes, but we're able to just kick off the IO
      and wait for progress.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      bf9022e0
    • C
      Btrfs: tune the chunk allocation to 5% of the FS as metadata · e5bc2458
      Chris Mason 提交于
      An earlier commit tried to keep us from allocating too many
      empty metadata chunks.  It was somewhat too restrictive and could
      lead to ENOSPC errors on empty filesystems.
      
      This increases the limits to about 5% of the FS size, allowing more
      metadata chunks to be preallocated.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      e5bc2458
    • C
      Add new functions for triggering inode writeback · 3259f8be
      Chris Mason 提交于
      When btrfs is running low on metadata space, it needs to force delayed
      allocation pages to disk.  It currently does this with a suboptimal walk
      of a private list of inodes with delayed allocation, and it would be
      much better if we used the generic flusher threads.
      
      writeback_inodes_sb_if_idle would be ideal, but it waits for the flusher
      thread to start IO on all the dirty pages in the FS before it returns.
      This adds variants of writeback_inodes_sb* that allow the caller to
      control how many pages get sent down.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      3259f8be
    • C
      Btrfs: don't loop forever on bad btree blocks · cb44921a
      Chris Mason 提交于
      When btrfs discovers the generation number in a btree block is
      incorrect, it can loop forever without forcing the RAID
      code to try a valid mirror, and without returning EIO.
      
      This changes things to properly kick out the EIO.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      cb44921a
    • J
      Btrfs: let the user know space caching is enabled · 8216ef86
      Josef Bacik 提交于
      If you mount -o space_cache, the option will be persistent across mounts, but to
      make sure the user knows that they did this, emit a message telling them if they
      didn't mount with -o space_cache but the feature is still used.
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      8216ef86
    • J
      Btrfs: Add a clear_cache mount option · 88c2ba3b
      Josef Bacik 提交于
      If something goes wrong with the free space cache we need a way to make sure
      it's not loaded on mount and that it's cleared for everybody.  When you pass the
      clear_cache option it will make it so all block groups are setup to be cleared,
      which keeps them from being loaded and then they will be truncated when the
      transaction is committed.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      88c2ba3b
    • J
      Btrfs: add support for mixed data+metadata block groups · 67377734
      Josef Bacik 提交于
      There are just a few things that need to be fixed in the kernel to support mixed
      data+metadata block groups.  Mostly we just need to make sure that if we are
      using mixed block groups that we continue to allocate mixed block groups as we
      need them.  Also we need to make sure __find_space_info will find our space info
      if we search for DATA or METADATA only.  Tested this with xfstests and it works
      nicely.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      67377734
    • J
      Btrfs: check cache->caching_ctl before returning if caching has started · dde5abee
      Josef Bacik 提交于
      With the free space disk caching we can mark the block group as started with the
      caching, but we don't have a caching ctl.  This can race with anybody else who
      tries to get the caching ctl before we cache (this is very hard to do btw).  So
      instead check to see if cache->caching_ctl is set, and if not return NULL.
      Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      dde5abee
    • J
      Btrfs: load free space cache if it exists · 9d66e233
      Josef Bacik 提交于
      This patch actually loads the free space cache if it exists.  The only thing
      that really changes here is that we need to cache the block group if we're going
      to remove an extent from it.  Previously we did not do this since the caching
      kthread would pick it up.  With the on disk cache we don't have this luxury so
      we need to make sure we read the on disk cache in first, and then remove the
      extent, that way when the extent is unpinned the free space is added to the
      block group.  This has been tested with all sorts of things.
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      9d66e233
    • J
      Btrfs: write out free space cache · 0cb59c99
      Josef Bacik 提交于
      This is a simple bit, just dump the free space cache out to our preallocated
      inode when we're writing out dirty block groups.  There are a bunch of changes
      in inode.c in order to account for special cases.  Mostly when we're doing the
      writeout we're holding trans_mutex, so we need to use the nolock transacation
      functions.  Also we can't do asynchronous completions since the async thread
      could be blocked on already completed IO waiting for the transaction lock.  This
      has been tested with xfstests and btrfs filesystem balance, as well as my ENOSPC
      tests.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      0cb59c99