Print this page
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>

@@ -21,13 +21,13 @@
 
 /*
  * 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
  */
 

@@ -12645,20 +12645,21 @@
                  * number.
                  */
                 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 {
+                        /*
+                         * 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;
-                                }
-
-                        case SD_RMW_TYPE_DEFAULT:
+                        } 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) {
                                         scsi_log(SD_DEVINFO(un), sd_label,
                                             CE_WARN, "I/O request is not "

@@ -12672,15 +12673,10 @@
                                             un, SD_RMW_MSG_PRINT_TIMEOUT);
                                 } else {
                                         un->un_rmw_incre_count ++;
                                 }
                                 mutex_exit(SD_MUTEX(un));
-                                break;
-
-                        case SD_RMW_TYPE_NO_WARNING:
-                        default:
-                                break;
                         }
 
                         nblocks = SD_TGT2SYSBLOCK(un, nblocks);
                         partition_offset = SD_TGT2SYSBLOCK(un,
                             partition_offset);