# HG changeset patch # User Hans Rosenfeld # Date 1361283406 18000 # Node ID 800b7743c4f35853e79cb7ae4908063aedc212f5 # Parent e03e14ddfb4c133258abda55b5cb9563dd12691e 3515 sd gives RMW warnings for reads Reviewed by: Albert Lee Reviewed by: Kevin Crowe Reviewed by: Gordon Ross Reviewed by: Garrett D'Amore Approved by: Richard Lowe diff -r e03e14ddfb4c -r 800b7743c4f3 usr/src/uts/common/io/scsi/targets/sd.c --- a/usr/src/uts/common/io/scsi/targets/sd.c Tue Feb 19 14:15:41 2013 -0800 +++ b/usr/src/uts/common/io/scsi/targets/sd.c Tue Feb 19 09:16:46 2013 -0500 @@ -23,9 +23,9 @@ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 Bayard G. Bell. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ /* * Copyright 2011 cyril.galibern@opensvc.com @@ -12647,16 +12647,17 @@ if (is_aligned) { xp->xb_blkno = SD_SYS2TGTBLOCK(un, xp->xb_blkno); } else { - switch (un->un_f_rmw_type) { - case SD_RMW_TYPE_RETURN_ERROR: - if (un->un_f_enable_rmw) - break; - else { - bp->b_flags |= B_ERROR; - goto error_exit; - } - - case SD_RMW_TYPE_DEFAULT: + /* + * There is no RMW if we're just reading, so don't + * warn or error out because of it. + */ + if (bp->b_flags & B_READ) { + /*EMPTY*/ + } else if (!un->un_f_enable_rmw && + un->un_f_rmw_type == SD_RMW_TYPE_RETURN_ERROR) { + bp->b_flags |= B_ERROR; + goto error_exit; + } else if (un->un_f_rmw_type == SD_RMW_TYPE_DEFAULT) { mutex_enter(SD_MUTEX(un)); if (!un->un_f_enable_rmw && un->un_rmw_msg_timeid == NULL) { @@ -12674,11 +12675,6 @@ un->un_rmw_incre_count ++; } mutex_exit(SD_MUTEX(un)); - break; - - case SD_RMW_TYPE_NO_WARNING: - default: - break; } nblocks = SD_TGT2SYSBLOCK(un, nblocks);