Print this page
NEX-8972 Async-delete side-effect that may cause unmount EBUSY
Reviewed by: Alek Pinchuk <alek@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-3762 Appliance crashes with a NULL pointer dereference during a zpool export when a zfs_vn_rele_taskq thread attempts to check a bogus rwlock from rw_write_held
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.

  24  */
  25 
  26 #ifndef _SYS_FS_ZFS_DIR_H
  27 #define _SYS_FS_ZFS_DIR_H
  28 
  29 #include <sys/pathname.h>
  30 #include <sys/dmu.h>
  31 #include <sys/zfs_znode.h>
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 /* zfs_dirent_lock() flags */
  38 #define ZNEW            0x0001          /* entry should not exist */
  39 #define ZEXISTS         0x0002          /* entry should exist */
  40 #define ZSHARED         0x0004          /* shared access (zfs_dirlook()) */
  41 #define ZXATTR          0x0008          /* we want the xattr dir */
  42 #define ZRENAMING       0x0010          /* znode is being renamed */
  43 #define ZCILOOK         0x0020          /* case-insensitive lookup requested */


  46 
  47 /* mknode flags */
  48 #define IS_ROOT_NODE    0x01            /* create a root node */
  49 #define IS_XATTR        0x02            /* create an extended attribute node */
  50 
  51 extern int zfs_dirent_lock(zfs_dirlock_t **, znode_t *, char *, znode_t **,
  52     int, int *, pathname_t *);
  53 extern void zfs_dirent_unlock(zfs_dirlock_t *);
  54 extern int zfs_link_create(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int);
  55 extern int zfs_link_destroy(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int,
  56     boolean_t *);
  57 extern int zfs_dirlook(znode_t *, char *, vnode_t **, int, int *,
  58     pathname_t *);
  59 extern void zfs_mknode(znode_t *, vattr_t *, dmu_tx_t *, cred_t *,
  60     uint_t, znode_t **, zfs_acl_ids_t *);
  61 extern void zfs_rmnode(znode_t *);
  62 extern void zfs_dl_name_switch(zfs_dirlock_t *dl, char *new, char **old);
  63 extern boolean_t zfs_dirempty(znode_t *);
  64 extern void zfs_unlinked_add(znode_t *, dmu_tx_t *);
  65 extern void zfs_unlinked_drain(zfsvfs_t *zfsvfs);

  66 extern int zfs_sticky_remove_access(znode_t *, znode_t *, cred_t *cr);
  67 extern int zfs_get_xattrdir(znode_t *, vnode_t **, cred_t *, int);
  68 extern int zfs_make_xattrdir(znode_t *, vattr_t *, vnode_t **, cred_t *);
  69 
  70 #ifdef  __cplusplus
  71 }
  72 #endif
  73 
  74 #endif  /* _SYS_FS_ZFS_DIR_H */


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2016 Nexenta Systems Inc. All rights reserved.
  25  */
  26 
  27 #ifndef _SYS_FS_ZFS_DIR_H
  28 #define _SYS_FS_ZFS_DIR_H
  29 
  30 #include <sys/pathname.h>
  31 #include <sys/dmu.h>
  32 #include <sys/zfs_znode.h>
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 /* zfs_dirent_lock() flags */
  39 #define ZNEW            0x0001          /* entry should not exist */
  40 #define ZEXISTS         0x0002          /* entry should exist */
  41 #define ZSHARED         0x0004          /* shared access (zfs_dirlook()) */
  42 #define ZXATTR          0x0008          /* we want the xattr dir */
  43 #define ZRENAMING       0x0010          /* znode is being renamed */
  44 #define ZCILOOK         0x0020          /* case-insensitive lookup requested */


  47 
  48 /* mknode flags */
  49 #define IS_ROOT_NODE    0x01            /* create a root node */
  50 #define IS_XATTR        0x02            /* create an extended attribute node */
  51 
  52 extern int zfs_dirent_lock(zfs_dirlock_t **, znode_t *, char *, znode_t **,
  53     int, int *, pathname_t *);
  54 extern void zfs_dirent_unlock(zfs_dirlock_t *);
  55 extern int zfs_link_create(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int);
  56 extern int zfs_link_destroy(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int,
  57     boolean_t *);
  58 extern int zfs_dirlook(znode_t *, char *, vnode_t **, int, int *,
  59     pathname_t *);
  60 extern void zfs_mknode(znode_t *, vattr_t *, dmu_tx_t *, cred_t *,
  61     uint_t, znode_t **, zfs_acl_ids_t *);
  62 extern void zfs_rmnode(znode_t *);
  63 extern void zfs_dl_name_switch(zfs_dirlock_t *dl, char *new, char **old);
  64 extern boolean_t zfs_dirempty(znode_t *);
  65 extern void zfs_unlinked_add(znode_t *, dmu_tx_t *);
  66 extern void zfs_unlinked_drain(zfsvfs_t *zfsvfs);
  67 extern void zfs_unlinked_drain_stop_wait(zfsvfs_t *zfsvfs);
  68 extern int zfs_sticky_remove_access(znode_t *, znode_t *, cred_t *cr);
  69 extern int zfs_get_xattrdir(znode_t *, vnode_t **, cred_t *, int);
  70 extern int zfs_make_xattrdir(znode_t *, vattr_t *, vnode_t **, cred_t *);
  71 
  72 #ifdef  __cplusplus
  73 }
  74 #endif
  75 
  76 #endif  /* _SYS_FS_ZFS_DIR_H */