dcssblk: issue warning when trying to save SN/EN type DCSS
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Fri, 16 Jan 2015 17:29:04 +0000 (18:29 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 22 Jan 2015 11:16:04 +0000 (12:16 +0100)
The content of a DCSS of type SN or EN cannot be saved. Issue a warning when
trying to save such a DCSS. Depending on the setup, this may be a user error
or intended behaviour e.g. with a multi-DCSS device.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dcssblk.c

index b550c8c8d0103e052689d125e3daacea2f30d993..7f900229404dfd722c846c379b67d4b982d414d8 100644 (file)
@@ -438,7 +438,13 @@ dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char
                        pr_info("All DCSSs that map to device %s are "
                                "saved\n", dev_info->segment_name);
                        list_for_each_entry(entry, &dev_info->seg_list, lh) {
-                               segment_save(entry->segment_name);
+                               if (entry->segment_type == SEG_TYPE_EN ||
+                                   entry->segment_type == SEG_TYPE_SN)
+                                       pr_warn("DCSS %s is of type SN or EN"
+                                               " and cannot be saved\n",
+                                               entry->segment_name);
+                               else
+                                       segment_save(entry->segment_name);
                        }
                }  else {
                        // device is busy => we save it when it becomes
@@ -797,7 +803,12 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
                pr_info("Device %s has become idle and is being saved "
                        "now\n", dev_info->segment_name);
                list_for_each_entry(entry, &dev_info->seg_list, lh) {
-                       segment_save(entry->segment_name);
+                       if (entry->segment_type == SEG_TYPE_EN ||
+                           entry->segment_type == SEG_TYPE_SN)
+                               pr_warn("DCSS %s is of type SN or EN and cannot"
+                                       " be saved\n", entry->segment_name);
+                       else
+                               segment_save(entry->segment_name);
                }
                dev_info->save_pending = 0;
        }