If you put a JBOD 4K disk in an IOA that doesn't support 4K AF devices
it will work, but iprconfig will not recognize it as
IPR_BLK_DEV_CLASS_4K. In this case, when we try to format it for RAID,
iprconfig will try to set the block size as 512, which will fail the
format command silently.  This patch makes sure IPR_BLK_DEV_CLASS_4K is
set for every 4K device, despite the IOA supporting 4K AF devices or
not.  Then, the verification for it in format_for_raid():13852 will
actually work, and we will abort the format earlier with an error
message, instead of failing silently.

Setting IPR_BLK_DEV_CLASS_4K for every device should not be an issue,
since in every other place it is referenced, we also check for
dev->ioa->support_4k and ipr_is_af_dasd_device().

This also adds a '\n' at the end of the error message cited above, to
improve readability.

Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
---
 iprconfig.c | 2 +-
 iprlib.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/iprconfig.c b/iprconfig.c
index 8d97065..7417de0 100644
--- a/iprconfig.c
+++ b/iprconfig.c
@@ -13850,7 +13850,7 @@ static int format_for_raid(char **args, int num_args)
                }
 
                if (!dev->ioa->support_4k && dev->block_dev_class & 
IPR_BLK_DEV_CLASS_4K) {
-                       fprintf(stderr, "Invalid device specified: %s. 4K disks 
not supprted on this adapter", args[i]);
+                       fprintf(stderr, "Invalid device specified: %s. 4K disks 
not supprted on this adapter\n", args[i]);
                        return -EINVAL;
                }
 
diff --git a/iprlib.c b/iprlib.c
index eb077a5..9249583 100644
--- a/iprlib.c
+++ b/iprlib.c
@@ -6497,7 +6497,7 @@ void check_current_config(bool allow_rebuild_refresh)
                                                        
IPR_DEV_CACHE_WRITE_THROUGH;
                                }
 
-                               if (ioa->support_4k && scsi_dev_data->type == 
TYPE_DISK) {
+                               if (scsi_dev_data->type == TYPE_DISK) {
                                        if 
(ipr_get_logical_block_size(&ioa->dev[device_count]) == IPR_JBOD_4K_BLOCK_SIZE)
                                                
ioa->dev[device_count].block_dev_class |= IPR_BLK_DEV_CLASS_4K;
                                }
-- 
2.1.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to