From dd3928f816b8d87f7ecc81d6ec1eec1257ed0cda Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Thu, 18 Sep 2014 14:20:00 +0200 Subject: 5182 use after free in blkdev Reviewed by: Marcel Telka Reviewed by: Igor Kozhukhov Reviewed by: Josef 'Jeff' Sipek Reviewed by: Garrett D'Amore Approved by: Dan McDonald --- usr/src/uts/common/io/blkdev/blkdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/io/blkdev/blkdev.c b/usr/src/uts/common/io/blkdev/blkdev.c index a34aec9fdd..bd31589e56 100644 --- a/usr/src/uts/common/io/blkdev/blkdev.c +++ b/usr/src/uts/common/io/blkdev/blkdev.c @@ -1311,7 +1311,6 @@ bd_sched(bd_t *bd) rv = xi->i_func(bd->d_private, &xi->i_public); if (rv != 0) { bp = xi->i_bp; - bd_xfer_free(xi); bioerror(bp, rv); biodone(bp); @@ -1319,6 +1318,7 @@ bd_sched(bd_t *bd) bd->d_qactive--; kstat_runq_exit(bd->d_kiop); list_remove(&bd->d_runq, xi); + bd_xfer_free(xi); } else { mutex_enter(&bd->d_iomutex); } -- cgit v1.2.3 From 655967ab7780f789dd00eece4464be60cd9aff5e Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Wed, 17 Sep 2014 15:27:13 +0200 Subject: 5181 nscd is extremely slow when a local file is missing Reviewed by: Alek Pinchuk Reviewed by: Igor Kozhukhov Reviewed by: Josef Sipek Reviewed by: Garrett D'Amore Approved by: Robert Mustacchi --- usr/src/lib/nsswitch/files/common/files_common.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'usr/src') diff --git a/usr/src/lib/nsswitch/files/common/files_common.c b/usr/src/lib/nsswitch/files/common/files_common.c index 4b7b6753c1..4755aec86b 100644 --- a/usr/src/lib/nsswitch/files/common/files_common.c +++ b/usr/src/lib/nsswitch/files/common/files_common.c @@ -21,7 +21,12 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * + */ +/* + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + */ + +/* * Common code and structures used by name-service-switch "files" backends. */ @@ -406,11 +411,13 @@ retry: retries = 100; while (stat64(be->filename, &st) < 0) { /* - * On a healthy system this can't happen except during brief - * periods when the file is being modified/renamed. Keep - * trying until things settle down, but eventually give up. + * This can happen only in two cases: Either the file is + * completely missing and we were not able to read it yet + * (fh_table is NULL), or there is some brief period when the + * file is being modified/renamed. Keep trying until things + * settle down, but eventually give up. */ - if (--retries == 0) + if (fhp->fh_table == NULL || --retries == 0) goto unavail; poll(0, 0, 100); } -- cgit v1.2.3 From f6164ad638e7346c4ae4ba393760a897cf6eb744 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Thu, 18 Sep 2014 20:03:53 -0800 Subject: 5174 add sdt probe for blocked read in dbuf_read() Reviewed by: Basil Crow Reviewed by: Matthew Ahrens Reviewed by: Steven Hartland Reviewed by: Richard Elling Reviewed by: Boris Protopopov Reviewed by: Steven Hartland Reviewed by: Garrett D'Amore Approved by: Robert Mustacchi --- usr/src/uts/common/fs/zfs/dbuf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr/src') diff --git a/usr/src/uts/common/fs/zfs/dbuf.c b/usr/src/uts/common/fs/zfs/dbuf.c index 4b0ec01a02..8d064daf25 100644 --- a/usr/src/uts/common/fs/zfs/dbuf.c +++ b/usr/src/uts/common/fs/zfs/dbuf.c @@ -671,6 +671,8 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags) db->db_state == DB_FILL) { ASSERT(db->db_state == DB_READ || (flags & DB_RF_HAVESTRUCT) == 0); + DTRACE_PROBE2(blocked__read, dmu_buf_impl_t *, + db, zio_t *, zio); cv_wait(&db->db_changed, &db->db_mtx); } if (db->db_state == DB_UNCACHED) -- cgit v1.2.3 From 42fcb65ea4f2c6f8cc5a3c6142a486cb49871fd2 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Thu, 18 Sep 2014 20:08:22 -0800 Subject: 5150 zfs clone of a defer_destroy snapshot causes strangeness Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Max Grossman Reviewed by: Saso Kiselkov Reviewed by: Richard Elling Approved by: Robert Mustacchi --- usr/src/uts/common/fs/zfs/dsl_dataset.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/fs/zfs/dsl_dataset.c b/usr/src/uts/common/fs/zfs/dsl_dataset.c index c075c6ac3d..f1b92f3eaa 100644 --- a/usr/src/uts/common/fs/zfs/dsl_dataset.c +++ b/usr/src/uts/common/fs/zfs/dsl_dataset.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -692,7 +692,13 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin, dsphys->ds_uncompressed_bytes = origin->ds_phys->ds_uncompressed_bytes; dsphys->ds_bp = origin->ds_phys->ds_bp; - dsphys->ds_flags |= origin->ds_phys->ds_flags; + + /* + * Inherit flags that describe the dataset's contents + * (INCONSISTENT) or properties (Case Insensitive). + */ + dsphys->ds_flags |= origin->ds_phys->ds_flags & + (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); dmu_buf_will_dirty(origin->ds_dbuf, tx); origin->ds_phys->ds_num_children++; -- cgit v1.2.3