From patchwork Tue Dec 15 18:29:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 7856651 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F10C29F1C2 for ; Tue, 15 Dec 2015 18:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32F1520225 for ; Tue, 15 Dec 2015 18:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22DD6203A5 for ; Tue, 15 Dec 2015 18:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932575AbbLOSaF (ORCPT ); Tue, 15 Dec 2015 13:30:05 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:45572 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932486AbbLOSaE (ORCPT ); Tue, 15 Dec 2015 13:30:04 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tBFIU3WC005153 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Dec 2015 18:30:03 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tBFIU2c9021170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 15 Dec 2015 18:30:03 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tBFIU2xo030999; Tue, 15 Dec 2015 18:30:02 GMT Received: from mellowmood.mkp.net (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 Dec 2015 10:30:02 -0800 To: Eryu Guan Cc: Ming Lei , Linux SCSI List , "Martin K. Petersen" Subject: Re: kernel BUG at block/bio.c:1787! while initializing scsi_debug on ppc64 host From: "Martin K. Petersen" Organization: Oracle Corporation References: <20151211115340.GB19209@eguan.usersys.redhat.com> <20151215112057.GC19209@eguan.usersys.redhat.com> <20151215130631.GD19209@eguan.usersys.redhat.com> Date: Tue, 15 Dec 2015 13:29:59 -0500 In-Reply-To: <20151215130631.GD19209@eguan.usersys.redhat.com> (Eryu Guan's message of "Tue, 15 Dec 2015 21:06:31 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP >>>>> "Eryu" == Eryu Guan writes: Eryu, Does the patch below fix the issue? diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3d22fc3e3c1a..d1eb7aa78b8d 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2667,8 +2667,9 @@ static void sd_read_block_limits(struct scsi_disk *sdkp) if (buffer[3] == 0x3c) { unsigned int lba_count, desc_count; + u64 max_ws = get_unaligned_be64(&buffer[36]); - sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]); + sdkp->max_ws_blocks = (u32)max_ws; if (!sdkp->lbpme) goto out;