1. 22 1月, 2015 29 次提交
    • Z
      Btrfs: Introduce BTRFS_BLOCK_GROUP_RAID56_MASK to check raid56 simply · ffe2d203
      Zhao Lei 提交于
      So we can check raid56 with:
       (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
      instead of long:
       (map->type & (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6))
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      ffe2d203
    • Z
      Btrfs: Include map_type in raid_bio · 10f11900
      Zhao Lei 提交于
      Corrent code use many kinds of "clever" way to determine operation
      target's raid type, as:
        raid_map != NULL
        or
        raid_map[MAX_NR] == RAID[56]_Q_STRIPE
      
      To make code easy to maintenance, this patch put raid type into
      bbio, and we can always get raid type from bbio with a "stupid"
      way.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      10f11900
    • Z
      Btrfs: Simplify scrub_setup_recheck_block()'s argument · be50a8dd
      Zhao Lei 提交于
      scrub_setup_recheck_block() have many arguments but most of them
      can be get from one of them, we can remove them to make code clean.
      Some other cleanup for that function also included in this patch.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      be50a8dd
    • Z
      Btrfs: Combine per-page recover in dev-replace and scrub · b968fed1
      Zhao Lei 提交于
      The code are similar, combine them to make code clean and easy to maintenance.
      Some lost condition are also completed with benefit of this combination.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      b968fed1
    • Z
      Btrfs: Separate finding-right-mirror and writing-to-target's process in... · 8d6738c1
      Zhao Lei 提交于
      Btrfs: Separate finding-right-mirror and writing-to-target's process in scrub_handle_errored_block()
      
      In corrent code, code of finding-right-mirror and writing-to-target
      are mixed in logic, if we find a right mirror but failed in writing
      to target, it will treat as "hadn't found right block", and fill the
      target with sblock_bad.
      
      Actually, "failed in writing to target" does not mean "source
      block is wrong", this patch separate above two condition in logic,
      and do some cleanup to make code clean.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      8d6738c1
    • Z
      Btrfs: Break loop when reach BTRFS_MAX_MIRRORS in scrub_setup_recheck_block() · dc5f7a3b
      Zhao Lei 提交于
      Use break instead of useless loop should be more suitable in this
      case.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      dc5f7a3b
    • Z
      Btrfs: btrfs_rm_dev_replace_blocked(): Use wait_event() · 7653947f
      Zhao Lei 提交于
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      7653947f
    • Z
      Btrfs: Cleanup btrfs_bio_counter_inc_blocked() · 09dd7a01
      Zhao Lei 提交于
      1: Remove no-need DEFINE_WAIT(wait)
      2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
      3: Use while loop instead of goto
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      09dd7a01
    • Z
      Btrfs: Remove noneed force_write in scrub_write_block_to_dev_replace · 114ab50d
      Zhao Lei 提交于
      It is always 1 in this place, because !1 case was already jumped
      out in previous code.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      114ab50d
    • Z
      Btrfs: Fix a jump typo of nodatasum_case to avoid wrong WARN_ON() · b25c94c5
      Zhao Lei 提交于
      if (sctx->is_dev_replace && !is_metadata && !have_csum) {
          ...
          goto nodatasum_case;
      }
      ...
      nodatasum_case:
          WARN_ON(sctx->is_dev_replace);
      
      In above code, nodatasum_case marker should be moved after
      WARN_ON().
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      b25c94c5
    • Z
      Btrfs: add ref_count and free function for btrfs_bio · 6e9606d2
      Zhao Lei 提交于
      1: ref_count is simple than current RBIO_HOLD_BBIO_MAP_BIT flag
         to keep btrfs_bio's memory in raid56 recovery implement.
      2: free function for bbio will make code clean and flexible, plus
         forced data type checking in compile.
      
      Changelog v1->v2:
       Rename following by David Sterba's suggestion:
       put_btrfs_bio() -> btrfs_put_bio()
       get_btrfs_bio() -> btrfs_get_bio()
       bbio->ref_count -> bbio->refs
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      6e9606d2
    • Z
      Btrfs: Make raid_map array be inlined in btrfs_bio structure · 8e5cfb55
      Zhao Lei 提交于
      It can make code more simple and clear, we need not care about
      free bbio and raid_map together.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      8e5cfb55
    • Z
      Btrfs: sort raid_map before adding tgtdev stripes · cc7539ed
      Zhao Lei 提交于
      It can avoid complex calculation of real stripes in sort,
      moreover, we can clean up code of sorting tgtdev_map because it
      will be in order initially.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      cc7539ed
    • Z
      Btrfs: fix a out-of-bound access of raid_map · e34c330d
      Zhao Lei 提交于
      We add the number of stripes on target devices into bbio->num_stripes
      if we are under device replacement, and we just sort the raid_map of
      those stripes that not on the target devices, so if when we need
      real raid_map, we need skip the stripes on the target devices.
      Signed-off-by: NZhao Lei <zhaolei@cn.fujitsu.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      e34c330d
    • F
      Btrfs: fix fsync log replay for inodes with a mix of regular refs and extrefs · df8d116f
      Filipe Manana 提交于
      If we have an inode with a large number of hard links, some of which may
      be extrefs, turn a regular ref into an extref, fsync the inode and then
      replay the fsync log (after a crash/reboot), we can endup with an fsync
      log that makes the replay code always fail with -EOVERFLOW when processing
      the inode's references.
      
      This is easy to reproduce with the test case I made for xfstests. Its steps
      are the following:
      
         _scratch_mkfs "-O extref" >> $seqres.full 2>&1
         _init_flakey
         _mount_flakey
      
         # Create a test file with 3001 hard links. This number is large enough to
         # make btrfs start using extrefs at some point even if the fs has the maximum
         # possible leaf/node size (64Kb).
         echo "hello world" > $SCRATCH_MNT/foo
         for i in `seq 1 3000`; do
             ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_`printf "%04d" $i`
         done
      
         # Make sure all metadata and data are durably persisted.
         sync
      
         # Now remove one link, add a new one with a new name, add another new one with
         # the same name as the one we just removed and fsync the inode.
         rm -f $SCRATCH_MNT/foo_link_0001
         ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3001
         ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_0001
         rm -f $SCRATCH_MNT/foo_link_0002
         ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3002
         ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3003
         $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
      
         # Simulate a crash/power loss. This makes sure the next mount
         # will see an fsync log and will replay that log.
      
         _load_flakey_table $FLAKEY_DROP_WRITES
         _unmount_flakey
      
         _load_flakey_table $FLAKEY_ALLOW_WRITES
         _mount_flakey
      
         # Check that the number of hard links is correct, we are able to remove all
         # the hard links and read the file's data. This is just to verify we don't
         # get stale file handle errors (due to dangling directory index entries that
         # point to inodes that no longer exist).
         echo "Link count: $(stat --format=%h $SCRATCH_MNT/foo)"
         [ -f $SCRATCH_MNT/foo ] || echo "Link foo is missing"
         for ((i = 1; i <= 3003; i++)); do
             name=foo_link_`printf "%04d" $i`
             if [ $i -eq 2 ]; then
                 [ -f $SCRATCH_MNT/$name ] && echo "Link $name found"
             else
                 [ -f $SCRATCH_MNT/$name ] || echo "Link $name is missing"
             fi
         done
         rm -f $SCRATCH_MNT/foo_link_*
         cat $SCRATCH_MNT/foo
         rm -f $SCRATCH_MNT/foo
      
         status=0
         exit
      
      The fix is simply to correct the overflow condition when overwriting a
      reference item because it was wrong, trying to increase the item in the
      fs/subvol tree by an impossible amount. Also ensure that we don't insert
      one normal ref and one ext ref for the same dentry - this happened because
      processing a dir index entry from the parent in the log happened when
      the normal ref item was full, which made the logic insert an extref and
      later when the normal ref had enough room, it would be inserted again
      when processing the ref item from the child inode in the log.
      
      This issue has been present since the introduction of the extrefs feature
      (2012).
      
      A test case for xfstests follows soon. This test only passes if the previous
      patch titled "Btrfs: fix fsync when extend references are added to an inode"
      is applied too.
      Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      df8d116f
    • F
      Btrfs: fix fsync when extend references are added to an inode · 2c2c452b
      Filipe Manana 提交于
      If we added an extended reference to an inode and fsync'ed it, the log
      replay code would make our inode have an incorrect link count, which
      was lower then the expected/correct count.
      This resulted in stale directory index entries after deleting some of
      the hard links, and any access to the dangling directory entries resulted
      in -ESTALE errors because the entries pointed to inode items that don't
      exist anymore.
      
      This is easy to reproduce with the test case I made for xfstests, and
      the bulk of that test is:
      
          _scratch_mkfs "-O extref" >> $seqres.full 2>&1
          _init_flakey
          _mount_flakey
      
          # Create a test file with 3001 hard links. This number is large enough to
          # make btrfs start using extrefs at some point even if the fs has the maximum
          # possible leaf/node size (64Kb).
          echo "hello world" > $SCRATCH_MNT/foo
          for i in `seq 1 3000`; do
              ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_`printf "%04d" $i`
          done
      
          # Make sure all metadata and data are durably persisted.
          sync
      
          # Add one more link to the inode that ends up being a btrfs extref and fsync
          # the inode.
          ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3001
          $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
      
          # Simulate a crash/power loss. This makes sure the next mount
          # will see an fsync log and will replay that log.
      
          _load_flakey_table $FLAKEY_DROP_WRITES
          _unmount_flakey
      
          _load_flakey_table $FLAKEY_ALLOW_WRITES
          _mount_flakey
      
          # Now after the fsync log replay btrfs left our inode with a wrong link count N,
          # which was smaller than the correct link count M (N < M).
          # So after removing N hard links, the remaining M - N directory entries were
          # still visible to user space but it was impossible to do anything with them
          # because they pointed to an inode that didn't exist anymore. This resulted in
          # stale file handle errors (-ESTALE) when accessing those dentries for example.
          #
          # So remove all hard links except the first one and then attempt to read the
          # file, to verify we don't get an -ESTALE error when accessing the inodel
          #
          # The btrfs fsck tool also detected the incorrect inode link count and it
          # reported an error message like the following:
          #
          # root 5 inode 257 errors 2001, no inode item, link count wrong
          #   unresolved ref dir 256 index 2978 namelen 13 name foo_link_2976 filetype 1 errors 4, no inode ref
          #
          # The fstests framework automatically calls fsck after a test is run, so we
          # don't need to call fsck explicitly here.
      
          rm -f $SCRATCH_MNT/foo_link_*
          cat $SCRATCH_MNT/foo
      
          status=0
          exit
      
      So make sure an fsync always flushes the delayed inode item, so that the
      fsync log contains it (needed in order to trigger the link count fixup
      code) and fix the extref counting function, which always return -ENOENT
      to its caller (and made it assume there were always 0 extrefs).
      
      This issue has been present since the introduction of the extrefs feature
      (2012).
      
      A test case for xfstests follows soon.
      Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      2c2c452b
    • F
      Btrfs: fix directory inconsistency after fsync log replay · d36808e0
      Filipe Manana 提交于
      If we have an inode (file) with a link count greater than 1, remove
      one of its hard links, fsync the inode, power fail/crash and then
      replay the fsync log on the next mount, we end up getting the parent
      directory's metadata inconsistent - its i_size still reflects the
      deleted hard link and has dangling index entries (with no matching
      inode reference entries). This prevents the directory from ever being
      deletable, as its i_size can never decrease to BTRFS_EMPTY_DIR_SIZE
      even if all of its children inodes are deleted, and the dangling index
      entries can never be removed (as they point to an inode that does not
      exist anymore).
      
      This is easy to reproduce with the following excerpt from the test case
      for xfstests that I just made:
      
          _scratch_mkfs >> $seqres.full 2>&1
      
          _init_flakey
          _mount_flakey
      
          # Create a test file with 2 hard links in the same directory.
          mkdir -p $SCRATCH_MNT/a/b
          echo "hello world" > $SCRATCH_MNT/a/b/foo
          ln $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/a/b/bar
      
          # Make sure all metadata and data are durably persisted.
          sync
      
          # Now remove one of the hard links and fsync the inode.
          rm -f $SCRATCH_MNT/a/b/bar
          $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/a/b/foo
      
          # Simulate a crash/power loss. This makes sure the next mount
          # will see an fsync log and will replay that log.
      
          _load_flakey_table $FLAKEY_DROP_WRITES
          _unmount_flakey
      
          _load_flakey_table $FLAKEY_ALLOW_WRITES
          _mount_flakey
      
          # Remove the last hard link of the file and attempt to remove its parent
          # directory - this failed in btrfs because the fsync log and replay code
          # didn't decrement the parent directory's i_size and left dangling directory
          # index entries - this made the btrfs rmdir implementation always fail with
          # the error -ENOTEMPTY.
          #
          # The dangling directory index entries were visible to user space, but it was
          # impossible to do anything on them (unlink, open, read, write, stat, etc)
          # because the inode they pointed to did not exist anymore.
          #
          # The parent directory's metadata inconsistency (stale index entries) was
          # also detected by btrfs' fsck tool, which is run automatically by the fstests
          # framework when the test finishes. The error message reported by fsck was:
          #
          # root 5 inode 259 errors 2001, no inode item, link count wrong
          #   unresolved ref dir 258 index 3 namelen 3 name bar filetype 1 errors 4, no inode ref
          #
          rm -f $SCRATCH_MNT/a/b/*
          rmdir $SCRATCH_MNT/a/b
          rmdir $SCRATCH_MNT/a
      
      To fix this just make sure that after an unlink, if the inode is fsync'ed,
      he parent inode is fully logged in the fsync log.
      
      A test case for xfstests follows soon.
      Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      d36808e0
    • F
      Btrfs: lookup for block group only if needed when freeing a tree block · 6219872d
      Filipe Manana 提交于
      Very often our extent buffer's header generation doesn't match the current
      transaction's id or it is also referenced by other trees (snapshots), so
      we don't need the corresponding block group cache object. Therefore only
      search for it if we are going to use it, so we avoid an unnecessary search
      in the block groups rbtree (and acquiring and releasing its spinlock).
      
      Freeing a tree block is performed when COWing or deleting a node/leaf,
      which implies we are holding the node/leaf's parent node lock, therefore
      reducing the amount of time spent when freeing a tree block helps reducing
      the amount of time we are holding the parent node's lock.
      
      For example, for a run of xfstests/generic/083, the block group cache
      object was needed only 682 times for a total of 226691 calls to free
      a tree block.
      Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      6219872d
    • D
      btrfs: remove a no-op unfreeze superbock callback · 730a78c7
      David Sterba 提交于
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      730a78c7
    • D
      btrfs: switch extent_state state to unsigned · 9ee49a04
      David Sterba 提交于
      Currently there's a 4B hole in the structure between refs and state and there
      are only 16 bits used so we can make it unsigned. This will get a better
      packing and may save some stack space for local variables.
      
      The size of extent_state gets reduced by 8B and there are usually a lot
      of slab objects.
      
      struct extent_state {
      	u64                        start;                /*     0     8 */
      	u64                        end;                  /*     8     8 */
      	struct rb_node             rb_node;              /*    16    24 */
      	wait_queue_head_t          wq;                   /*    40    24 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	atomic_t                   refs;                 /*    64     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	long unsigned int          state;                /*    72     8 */
      	u64                        private;              /*    80     8 */
      
      	/* size: 88, cachelines: 2, members: 7 */
      	/* sum members: 84, holes: 1, sum holes: 4 */
      	/* last cacheline: 24 bytes */
      };
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      9ee49a04
    • D
      btrfs: set proper message level for skinny metadata · 5efa0490
      David Sterba 提交于
      This has been confusing people for too long, the message is really just
      informative.
      
      CC: <stable@vger.kernel.org> # 3.10+
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      5efa0490
    • D
      btrfs: update message levels after checksum errors · f0954c66
      David Sterba 提交于
      The errors are worth noting and might get missed with INFO level.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      f0954c66
    • D
      btrfs: update message levels during failed mount · aa8ee312
      David Sterba 提交于
      All error conditions from open_ctree shall be ERR. Warning would
      suggest that something's wrong and we can continue.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      aa8ee312
    • D
      btrfs: update message levels for errors · 68b663d1
      David Sterba 提交于
      Several messages that point to some internal problem, level INFO is
      wrong here.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <clm@fb.com>
      68b663d1
    • F
      Btrfs: fix setup_leaf_for_split() to avoid leaf corruption · a8df6fe6
      Filipe Manana 提交于
      We were incorrectly detecting when the target key didn't exist anymore
      after releasing the path and re-searching the tree. This could make
      us split or duplicate (btrfs_split_item() and btrfs_duplicate_item()
      are its only callers at the moment) an item when we should not.
      
      For the case of duplicating an item, we currently only duplicate
      checksum items (csum tree) and file extent items (fs/subvol trees).
      For the checksum items we end up overriding the item completely,
      but for file extent items we update only some of their fields in
      the copy (done in __btrfs_drop_extents), which means we can end up
      having a logical corruption for some values.
      
      Also for the case where we duplicate a file extent item it will make
      us produce a leaf with a wrong key order, as btrfs_duplicate_item()
      advances us to the next slot and then its caller sets a smaller key
      on the new item at that slot (like in __btrfs_drop_extents() e.g.).
      Alternatively if the tree search in setup_leaf_for_split() leaves
      with path->slots[0] == btrfs_header_nritems(path->nodes[0]), we end
      up accessing beyond the leaf's end (when we check if the item's size
      has changed) and make our caller insert an item at the invalid slot
      btrfs_header_nritems(path->nodes[0]) + 1, causing an invalid memory
      access if the leaf is full or nearly full.
      
      This issue has been present since the introduction of this function
      in 2009:
      
          Btrfs: Add btrfs_duplicate_item
          commit ad48fd75Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      a8df6fe6
    • C
      Merge branch 'cleanup/blocksize-diet-part2' of... · 57bbddd7
      Chris Mason 提交于
      Merge branch 'cleanup/blocksize-diet-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
      57bbddd7
    • C
      Merge branch 'fix/find-item-path-leak' of... · d3541834
      Chris Mason 提交于
      Merge branch 'fix/find-item-path-leak' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
      d3541834
    • J
      Btrfs: track dirty block groups on their own list · ce93ec54
      Josef Bacik 提交于
      Currently any time we try to update the block groups on disk we will walk _all_
      block groups and check for the ->dirty flag to see if it is set.  This function
      can get called several times during a commit.  So if you have several terabytes
      of data you will be a very sad panda as we will loop through _all_ of the block
      groups several times, which makes the commit take a while which slows down the
      rest of the file system operations.
      
      This patch introduces a dirty list for the block groups that we get added to
      when we dirty the block group for the first time.  Then we simply update any
      block groups that have been dirtied since the last time we called
      btrfs_write_dirty_block_groups.  This allows us to clean up how we write the
      free space cache out so it is much cleaner.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      ce93ec54
    • J
      Btrfs: change how we track dirty roots · e7070be1
      Josef Bacik 提交于
      I've been overloading root->dirty_list to keep track of dirty roots and which
      roots need to have their commit roots switched at transaction commit time.  This
      could cause us to lose an update to the root which could corrupt the file
      system.  To fix this use a state bit to know if the root is dirty, and if it
      isn't set we go ahead and move the root to the dirty list.  This way if we
      re-dirty the root after adding it to the switch_commit list we make sure to
      update it.  This also makes it so that the extent root is always the last root
      on the dirty list to try and keep the amount of churn down at this point in the
      commit.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NChris Mason <clm@fb.com>
      e7070be1
  2. 18 1月, 2015 9 次提交
    • L
      Linux 3.19-rc5 · ec6f34e5
      Linus Torvalds 提交于
      ec6f34e5
    • L
      Merge tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d0ac5d8e
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "We've been sitting on our fixes branch for a while, so this batch is
        unfortunately on the large side.
      
        A lot of these are tweaks and fixes to device trees, fixing various
        bugs around clocks, reg ranges, etc.  There's also a few defconfig
        updates (which are on the late side, no more of those).
      
        All in all the diffstat is bigger than ideal at this time, but nothing
        in here seems particularly risky"
      
      * tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits)
        reset: sunxi: fix spinlock initialization
        ARM: dts: disable CCI on exynos5420 based arndale-octa
        drivers: bus: check cci device tree node status
        ARM: rockchip: disable jtag/sdmmc autoswitching on rk3288
        ARM: nomadik: fix up leftover device tree pins
        ARM: at91: board-dt-sama5: add phy_fixup to override NAND_Tree
        ARM: at91/dt: sam9263: Add missing clocks to lcdc node
        ARM: at91: sama5d3: dt: correct the sound route
        ARM: at91/dt: sama5d4: fix the timer reg length
        ARM: exynos_defconfig: Enable LM90 driver
        ARM: exynos_defconfig: Enable options for display panel support
        arm: dts: Use pmu_system_controller phandle for dp phy
        ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances
        ARM: dts: berlin: correct BG2Q's SM GPIO location.
        ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
        ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
        ARM: dts: Revert disabling of smc91x for n900
        ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling
        ARM: dts: dra7-evm: fix qspi device tree partition size
        ARM: omap2plus_defconfig: use CONFIG_CPUFREQ_DT
        ...
      d0ac5d8e
    • L
      Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux · 12ba8571
      Linus Torvalds 提交于
      Pull clock driver fixes from Mike Turquette:
       "Small number of fixes for clock drivers and a single null pointer
        dereference fix in the framework core code.
      
        The driver fixes vary from fixing section mismatch warnings to
        preventing machines from hanging (and preventing developers from
        crying)"
      
      * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux:
        clk: fix possible null pointer dereference
        Revert "clk: ppc-corenet: Fix Section mismatch warning"
        clk: rockchip: fix deadlock possibility in cpuclk
        clk: berlin: bg2q: remove non-exist "smemc" gate clock
        clk: at91: keep slow clk enabled to prevent system hang
        clk: rockchip: fix rk3288 cpuclk core dividers
        clk: rockchip: fix rk3066 pll lock bit location
        clk: rockchip: Fix clock gate for rk3188 hclk_emem_peri
        clk: rockchip: add CLK_IGNORE_UNUSED flag to fix rk3066/rk3188 USB Host
      12ba8571
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 901b2082
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "This is one fix for a Multiqueue sleeping in invalid context problem
        and a MAINTAINER file update for Qlogic"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ->queue_rq can't sleep
        MAINTAINERS: Update maintainer list for qla4xxx
      901b2082
    • S
      clk: fix possible null pointer dereference · c7662fc5
      Stanimir Varbanov 提交于
      The commit 646cafc6 (clk: Change clk_ops->determine_rate to
      return a clk_hw as the best parent) opens a possibility for
      null pointer dereference, fix this.
      Signed-off-by: NStanimir Varbanov <svarbanov@mm-sol.com>
      Reviewed-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NMichael Turquette <mturquette@linaro.org>
      c7662fc5
    • K
      Revert "clk: ppc-corenet: Fix Section mismatch warning" · 176a107b
      Kevin Hao 提交于
      This reverts commit da788acb.
      
      That commit tried to fix the section mismatch warning by moving the
      ppc_corenet_clk_driver struct to init section. This is definitely wrong
      because the kernel would free the memories occupied by this struct
      after boot while this driver is still registered in the driver core.
      The kernel would panic when accessing this driver struct.
      
      Cc: stable@vger.kernel.org # 3.17
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Acked-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NMichael Turquette <mturquette@linaro.org>
      176a107b
    • H
      clk: rockchip: fix deadlock possibility in cpuclk · a5e1baf7
      Heiko Stübner 提交于
      Lockdep reported a possible deadlock between the cpuclk lock and for example
      the i2c driver.
      
             CPU0                    CPU1
             ----                    ----
        lock(clk_lock);
                                     local_irq_disable();
                                     lock(&(&i2c->lock)->rlock);
                                     lock(clk_lock);
        <Interrupt>
          lock(&(&i2c->lock)->rlock);
      
       *** DEADLOCK ***
      
      The generic clock-types of the core ccf already use spin_lock_irqsave when
      touching clock registers, so do the same for the cpuclk.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NMichael Turquette <mturquette@linaro.org>
      [mturquette@linaro.org: removed initialization of "flags"]
      a5e1baf7
    • L
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 298e3204
      Linus Torvalds 提交于
      Pull dmaengine fixes from Vinod Koul:
       "Two patches, the first by Andy to fix dw dmac runtime pm and second
        one by me to fix the dmaengine headers in MAINTAINERS"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: dw: balance PM runtime calls
        MAINTAINERS: dmaengine: fix the header file for dmaengine
      298e3204
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 59b2858f
      Linus Torvalds 提交于
      Pull perf fixes from Ingo Molnar:
       "Mostly tooling fixes, but also two PMU driver fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools powerpc: Use dwfl_report_elf() instead of offline.
        perf tools: Fix segfault for symbol annotation on TUI
        perf test: Fix dwarf unwind using libunwind.
        perf tools: Avoid build splat for syscall numbers with uclibc
        perf tools: Elide strlcpy warning with uclibc
        perf tools: Fix statfs.f_type data type mismatch build error with uclibc
        tools: Remove bitops/hweight usage of bits in tools/perf
        perf machine: Fix __machine__findnew_thread() error path
        perf tools: Fix building error in x86_64 when dwarf unwind is on
        perf probe: Propagate error code when write(2) failed
        perf/x86/intel: Fix bug for "cycles:p" and "cycles:pp" on SLM
        perf/rapl: Fix sysfs_show() initialization for RAPL PMU
      59b2858f
  3. 17 1月, 2015 2 次提交
    • I
      Merge tag 'perf-urgent-for-mingo' of... · d01de238
      Ingo Molnar 提交于
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
        - Fix segfault when using both the map symtab viewer and annotation
          in the TUI (Namhyung Kim).
      
        - uClibc build fixes (Alexey Brodkin, Vineet Gupta).
      
        - bitops/hweight were moved from tools/perf/ too tools/include, move
          some leftovers (Arnaldo Carvalho de Melo)
      
        - Fix dwarf unwind x86_64 build error (Namhyung Kim)
      
        - Fix __machine__findnew_thread() error path (Namhyung Kim)
      
        - Propagate error code when write(2) failed in 'perf probe' (Namhyung Kim)
      
        - Use dwfl_report_elf() instead of offline in powerpc bits to
          properly handle non prelinked DSOs (Sukadev Bhattiprolu).
      
        - Fix dwarf unwind using libunwind in 'perf test' (Wang Nan)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      d01de238
    • O
      Merge tag 'samsung-fixes-3.19' of... · 966903a9
      Olof Johansson 提交于
      Merge tag 'samsung-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes
      
      Merge "Samsung fixes for v3.19" from Kukjin Kim:
      
      Samsung fixes for v3.19
      - exynos_defconfig: enable LM90 driver and display panel support
         - HWMON
         - SENSORS_LM90
         - Direct Rendering Manager (DRM)
         - DRM bridge registration and lookup framework
         - Parade ps8622/ps8625 eDP/LVDS bridge
         - NXP ptn3460 eDP/LVDS bridge
         - Exynos Fully Interactive Mobile Display controller (FIMD)
         - Panel registration and lookup framework
         - Simple panels
         - Backlight & LCD device support
      
      - use pmu_system_controller phandle for dp phy
        : DP PHY requires pmu_system_controller to handle PMU reg. now
      
      * tag 'samsung-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
        ARM: exynos_defconfig: Enable LM90 driver
        ARM: exynos_defconfig: Enable options for display panel support
        arm: dts: Use pmu_system_controller phandle for dp phy
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      966903a9