Skip to content

Commit

Permalink
Merge branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
dajhorn committed Sep 7, 2012
2 parents c79e345 + 1ecc6d1 commit 00e7cd5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions cmd/zstreamdump/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zstreamdump
12 changes: 6 additions & 6 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3134,6 +3134,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
char *path, *devid, *type;
uint64_t value;
char buf[PATH_BUF_LEN];
char tmpbuf[PATH_BUF_LEN];
vdev_stat_t *vs;
uint_t vsc;

Expand Down Expand Up @@ -3206,13 +3207,12 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
* If it's a raidz device, we need to stick in the parity level.
*/
if (strcmp(path, VDEV_TYPE_RAIDZ) == 0) {
char tmpbuf[PATH_BUF_LEN];

verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NPARITY,
&value) == 0);
(void) snprintf(tmpbuf, sizeof (tmpbuf), "%s%llu", path,
(void) snprintf(buf, sizeof (buf), "%s%llu", path,
(u_longlong_t)value);
path = tmpbuf;
path = buf;
}

/*
Expand All @@ -3224,9 +3224,9 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,

verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_ID,
&id) == 0);
(void) snprintf(buf, sizeof (buf), "%s-%llu", path,
(u_longlong_t)id);
path = buf;
(void) snprintf(tmpbuf, sizeof (tmpbuf), "%s-%llu",
path, (u_longlong_t)id);
path = tmpbuf;
}
}

Expand Down
13 changes: 9 additions & 4 deletions lib/libzpool/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
*
* We reduce the default stack size in userspace, to ensure
* we observe stack overruns in user space as well as in
* kernel space. PTHREAD_STACK_MIN is the minimum stack
* required for a NULL procedure in user space and is added
* in to the stack requirements.
* kernel space. In practice we can't set the userspace stack
* size to 8k because differences in stack usage between kernel
* space and userspace could lead to spurious stack overflows
* (especially when debugging is enabled). Nevertheless, we try
* to set it to the lowest value that works (currently 8k*4).
* PTHREAD_STACK_MIN is the minimum stack required for a NULL
* procedure in user space and is added in to the stack
* requirements.
*
* Some buggy NPTL threading implementations include the
* guard area within the stack size allocations. In
Expand All @@ -170,7 +175,7 @@ zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
* on Linux.
*/

stack = PTHREAD_STACK_MIN + MAX(stksize, STACK_SIZE) +
stack = PTHREAD_STACK_MIN + MAX(stksize, STACK_SIZE) * 4 +
EXTRA_GUARD_BYTES;

VERIFY3S(pthread_attr_init(&attr), ==, 0);
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/zap_leaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ zap_leaf_array_match(zap_leaf_t *l, zap_name_t *zn,

ASSERT(zn->zn_key_intlen == sizeof (*thiskey));
thiskey = kmem_alloc(array_numints * sizeof (*thiskey),
KM_SLEEP);
KM_PUSHPAGE);

zap_leaf_array_read(l, chunk, sizeof (*thiskey), array_numints,
sizeof (*thiskey), array_numints, thiskey);
Expand All @@ -353,7 +353,7 @@ zap_leaf_array_match(zap_leaf_t *l, zap_name_t *zn,

ASSERT(zn->zn_key_intlen == 1);
if (zn->zn_matchtype == MT_FIRST) {
char *thisname = kmem_alloc(array_numints, KM_SLEEP);
char *thisname = kmem_alloc(array_numints, KM_PUSHPAGE);
boolean_t match;

zap_leaf_array_read(l, chunk, sizeof (char), array_numints,
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/zap_micro.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ zap_name_alloc(zap_t *zap, const char *key, matchtype_t mt)
zap_name_t *
zap_name_alloc_uint64(zap_t *zap, const uint64_t *key, int numints)
{
zap_name_t *zn = kmem_alloc(sizeof (zap_name_t), KM_SLEEP);
zap_name_t *zn = kmem_alloc(sizeof (zap_name_t), KM_PUSHPAGE);

ASSERT(zap->zap_normflags == 0);
zn->zn_zap = zap;
Expand Down
6 changes: 4 additions & 2 deletions module/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,13 +920,15 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
{
zfs_sb_t *zsb = dentry->d_sb->s_fs_info;
uint64_t refdbytes, availbytes, usedobjs, availobjs;
uint64_t fsid;
uint32_t bshift;

ZFS_ENTER(zsb);

dmu_objset_space(zsb->z_os,
&refdbytes, &availbytes, &usedobjs, &availobjs);

fsid = dmu_objset_fsid_guid(zsb->z_os);
/*
* The underlying storage pool actually uses multiple block
* size. Under Solaris frsize (fragment size) is reported as
Expand Down Expand Up @@ -960,8 +962,8 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
*/
statp->f_ffree = MIN(availobjs, availbytes >> DNODE_SHIFT);
statp->f_files = statp->f_ffree + usedobjs;
statp->f_fsid.val[0] = dentry->d_sb->s_dev;
statp->f_fsid.val[1] = 0;
statp->f_fsid.val[0] = (uint32_t)fsid;
statp->f_fsid.val[1] = (uint32_t)(fsid >> 32);
statp->f_type = ZFS_SUPER_MAGIC;
statp->f_namelen = ZFS_MAXNAMELEN;

Expand Down
5 changes: 3 additions & 2 deletions module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ zio_buf_alloc(size_t size)

ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);

return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE));
return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE | KM_NODEBUG));
}

/*
Expand All @@ -275,7 +275,8 @@ zio_data_buf_alloc(size_t size)

ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);

return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE));
return (kmem_cache_alloc(zio_data_buf_cache[c],
KM_PUSHPAGE | KM_NODEBUG));
}

void
Expand Down

0 comments on commit 00e7cd5

Please sign in to comment.