1. 07 12月, 2017 6 次提交
  2. 01 12月, 2017 6 次提交
  3. 30 11月, 2017 8 次提交
  4. 29 11月, 2017 6 次提交
    • T
      quota: Check for register_shrinker() failure. · 88bc0ede
      Tetsuo Handa 提交于
      register_shrinker() might return -ENOMEM error since Linux 3.12.
      Call panic() as with other failure checks in this function if
      register_shrinker() failed.
      
      Fixes: 1d3d4437 ("vmscan: per-node deferred work")
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Jan Kara <jack@suse.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Reviewed-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      88bc0ede
    • E
      xfs: calculate correct offset in xfs_scrub_quota_item · 712d361d
      Eric Sandeen 提交于
      It's only used for tracepoints so it's relatively harmless,
      but the offset is calculated incorrectly in xfs_scrub_quota_item.
      
      qi_dqperchunk is the nr. of dquots per "chunk" which we have
      conveniently *cough* defined to always be 1 FSB.  Therefore
      block_offset * qi_dqperchunk == first id in that chunk,
      and so offset = id / qi_dqperchunk
      
      id * dqperchunk is ... meaningless.
      
      Fixes-coverity-id: 1423965
      Fixes: c2fc338c ("xfs: scrub quota information")
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      712d361d
    • E
      xfs: fix uninitialized variable in xfs_scrub_quota · eda6bc27
      Eric Sandeen 提交于
      On the first pass through the while(1) loop, we get to
      xfs_scrub_should_terminate() which can test the uninitialized
      error variable.
      
      Fixes-coverity-id: 1423737
      Fixes: c2fc338c ("xfs: scrub quota information")
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      eda6bc27
    • E
      xfs: fix leaks on corruption errors in xfs_bmap.c · d41c6172
      Eric Sandeen 提交于
      Use _GOTO instead of _RETURN so we can free the allocated
      cursor on error.
      
      Fixes: bf806280 ("xfs: remove xfs_bmse_shift_one")
      Fixes-coverity-id: 1423813, 1423676
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      d41c6172
    • M
      xfs: fortify xfs_alloc_buftarg error handling · d210a987
      Michal Hocko 提交于
      percpu_counter_init failure path doesn't clean up &btp->bt_lru list.
      Call list_lru_destroy in that error path. Similarly register_shrinker
      error path is not handled.
      
      While it is unlikely to trigger these error path, it is not impossible
      especially the later might fail with large NUMAs.  Let's handle the
      failure to make the code more robust.
      Noticed-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      d210a987
    • F
      Btrfs: incremental send, fix wrong unlink path after renaming file · ea37d599
      Filipe Manana 提交于
      Under some circumstances, an incremental send operation can issue wrong
      paths for unlink commands related to files that have multiple hard links
      and some (or all) of those links were renamed between the parent and send
      snapshots. Consider the following example:
      
      Parent snapshot
      
       .                                                      (ino 256)
       |---- a/                                               (ino 257)
       |     |---- b/                                         (ino 259)
       |     |     |---- c/                                   (ino 260)
       |     |     |---- f2                                   (ino 261)
       |     |
       |     |---- f2l1                                       (ino 261)
       |
       |---- d/                                               (ino 262)
             |---- f1l1_2                                     (ino 258)
             |---- f2l2                                       (ino 261)
             |---- f1_2                                       (ino 258)
      
      Send snapshot
      
       .                                                      (ino 256)
       |---- a/                                               (ino 257)
       |     |---- f2l1/                                      (ino 263)
       |             |---- b2/                                (ino 259)
       |                   |---- c/                           (ino 260)
       |                   |     |---- d3                     (ino 262)
       |                   |           |---- f1l1_2           (ino 258)
       |                   |           |---- f2l2_2           (ino 261)
       |                   |           |---- f1_2             (ino 258)
       |                   |
       |                   |---- f2                           (ino 261)
       |                   |---- f1l2                         (ino 258)
       |
       |---- d                                                (ino 261)
      
      When computing the incremental send stream the following steps happen:
      
      1) When processing inode 261, a rename operation is issued that renames
         inode 262, which currently as a path of "d", to an orphan name of
         "o262-7-0". This is done because in the send snapshot, inode 261 has
         of its hard links with a path of "d" as well.
      
      2) Two link operations are issued that create the new hard links for
         inode 261, whose names are "d" and "f2l2_2", at paths "/" and
         "o262-7-0/" respectively.
      
      3) Still while processing inode 261, unlink operations are issued to
         remove the old hard links of inode 261, with names "f2l1" and "f2l2",
         at paths "a/" and "d/". However path "d/" does not correspond anymore
         to the directory inode 262 but corresponds instead to a hard link of
         inode 261 (link command issued in the previous step). This makes the
         receiver fail with a ENOTDIR error when attempting the unlink
         operation.
      
      The problem happens because before sending the unlink operation, we failed
      to detect that inode 262 was one of ancestors for inode 261 in the parent
      snapshot, and therefore we didn't recompute the path for inode 262 before
      issuing the unlink operation for the link named "f2l2" of inode 262. The
      detection failed because the function "is_ancestor()" only follows the
      first hard link it finds for an inode instead of all of its hard links
      (as it was originally created for being used with directories only, for
      which only one hard link exists). So fix this by making "is_ancestor()"
      follow all hard links of the input inode.
      
      A test case for fstests follows soon.
      Signed-off-by: NFilipe Manana <fdmanana@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      ea37d599
  5. 28 11月, 2017 14 次提交