1. 26 Jan, 2012 4 commits
    • Mitch Harder's avatar
      Btrfs: Check for NULL page in extent_range_uptodate · 8bedd51b
      Mitch Harder authored
      A user has encountered a NULL pointer kernel oops in btrfs when
      encountering media errors.  The problem has been identified
      as an unhandled NULL pointer returned from find_get_page().
      This modification simply checks for a NULL page, and returns
      with an error if found (the extent_range_uptodate() function
      returns 1 on errors).
      
      After testing this patch, the user reported that the error with
      the NULL pointer oops was solved.  However, there is still a
      remaining problem with a thread becoming stuck in
      wait_on_page_locked(page) in the read_extent_buffer_pages(...)
      function in extent_io.c
      
             for (i = start_i; i < num_pages; i++) {
                     page = extent_buffer_page(eb, i);
                     wait_on_page_locked(page);
                     if (!PageUptodate(page))
                             ret = -EIO;
             }
      
      This patch leaves the issue with the locked page yet to be resolved.
      Signed-off-by: default avatarMitch Harder <mitch.harder@sabayonlinux.org>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      8bedd51b
    • Jan Kara's avatar
      btrfs: Fix busyloops in transaction waiting code · 6dd70ce4
      Jan Kara authored
      wait_log_commit() and wait_for_writer() were using slightly different
      conditions for deciding whether they should call schedule() and whether they
      should continue in the wait loop. Thus it could happen that we busylooped when
      the first condition was not true while the second one was. That is burning CPU
      cycles needlessly and is deadly on UP machines...
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      6dd70ce4
    • Josef Bacik's avatar
      Btrfs: make sure a bitmap has enough bytes · 357b9784
      Josef Bacik authored
      We have only been checking for min_bytes available in bitmap entries, but we
      won't successfully setup a bitmap cluster unless it has at least bytes in the
      bitmap, so in the common case min_bytes is 4k and we want something like 2MB, so
      if there are a bunch of bitmap entries with less than 2mb's in them, we'll
      search all them anyway, which is suboptimal.  Fix this check.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      357b9784
    • Jan Schmidt's avatar
      Btrfs: fix uninit warning in backref.c · b1375d64
      Jan Schmidt authored
      Added initialization with the declaration of ret. It isn't set later on the
      switch-default branch (which should never be taken).
      Signed-off-by: default avatarJan Schmidt <list.btrfs@jan-o-sch.net>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      b1375d64
  2. 16 Jan, 2012 35 commits
  3. 11 Jan, 2012 1 commit
    • Li Zefan's avatar
      Btrfs: fix possible deadlock when opening a seed device · b367e47f
      Li Zefan authored
      The correct lock order is uuid_mutex -> volume_mutex -> chunk_mutex,
      but when we mount a filesystem which has backing seed devices, we have
      this lock chain:
      
          open_ctree()
              lock(chunk_mutex);
              read_chunk_tree();
                  read_one_dev();
                      open_seed_devices();
                          lock(uuid_mutex);
      
      and then we hit a lockdep splat.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      b367e47f