Permalink
Browse files

3515 sd gives RMW warnings for reads

Reviewed by: Albert Lee <trisk@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information...
1 parent 16a4a80 commit 28f2c52052034474a5881e13013564f72ffa345f Hans Rosenfeld committed with richlowe Feb 19, 2013
Showing with 12 additions and 16 deletions.
  1. +12 −16 usr/src/uts/common/io/scsi/targets/sd.c
@@ -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 @@ sd_mapblockaddr_iostart(int index, struct sd_lun *un, struct buf *bp)
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 @@ sd_mapblockaddr_iostart(int index, struct sd_lun *un, struct buf *bp)
un->un_rmw_incre_count ++;
}
mutex_exit(SD_MUTEX(un));
- break;
-
- case SD_RMW_TYPE_NO_WARNING:
- default:
- break;
}
nblocks = SD_TGT2SYSBLOCK(un, nblocks);

0 comments on commit 28f2c52

Please sign in to comment.