Print this page
NEX-5553 ZFS auto-trim, manual-trim and scrub can race and deadlock
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-5064 On-demand trim should store operation start and stop time
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
NEX-3558 KRRP Integration

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dsl_synctask.c
          +++ new/usr/src/uts/common/fs/zfs/dsl_synctask.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
       24 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  #include <sys/dmu.h>
  27   28  #include <sys/dmu_tx.h>
  28   29  #include <sys/dsl_pool.h>
  29   30  #include <sys/dsl_dir.h>
  30   31  #include <sys/dsl_synctask.h>
  31   32  #include <sys/metaslab.h>
  32   33  
  33      -#define DST_AVG_BLKSHIFT 14
  34      -
  35   34  /* ARGSUSED */
  36   35  static int
  37   36  dsl_null_checkfunc(void *arg, dmu_tx_t *tx)
  38   37  {
  39   38          return (0);
  40   39  }
  41   40  
  42   41  /*
  43   42   * Called from open context to perform a callback in syncing context.  Waits
  44   43   * for the operation to complete.
↓ open down ↓ 60 lines elided ↑ open up ↑
 105  104          VERIFY(txg_list_add_tail(&dp->dp_sync_tasks, &dst, dst.dst_txg));
 106  105  
 107  106          dmu_tx_commit(tx);
 108  107  
 109  108          txg_wait_synced(dp, dst.dst_txg);
 110  109  
 111  110          if (dst.dst_error == EAGAIN) {
 112  111                  txg_wait_synced(dp, dst.dst_txg + TXG_DEFER_SIZE);
 113  112                  goto top;
 114  113          }
 115      -
 116  114          spa_close(spa, FTAG);
 117  115          return (dst.dst_error);
 118  116  }
 119  117  
 120  118  void
 121  119  dsl_sync_task_nowait(dsl_pool_t *dp, dsl_syncfunc_t *syncfunc, void *arg,
 122  120      int blocks_modified, zfs_space_check_t space_check, dmu_tx_t *tx)
 123  121  {
 124  122          dsl_sync_task_t *dst = kmem_zalloc(sizeof (*dst), KM_SLEEP);
 125  123  
↓ open down ↓ 61 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX