From patchwork Thu Sep 21 19:17:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 9964739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 965456020C for ; Thu, 21 Sep 2017 19:17:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F856283FE for ; Thu, 21 Sep 2017 19:17:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70FAC28438; Thu, 21 Sep 2017 19:17:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F27C8283FE for ; Thu, 21 Sep 2017 19:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbdIUTRU (ORCPT ); Thu, 21 Sep 2017 15:17:20 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:49413 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbdIUTRT (ORCPT ); Thu, 21 Sep 2017 15:17:19 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8LJ7mHc013033 for ; Thu, 21 Sep 2017 12:17:19 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=6Uww2DFANtqPpDI09bGB21hfX8dr89rselD1LcRjCUA=; b=A0NUA6Reeg0hpJSyjdJrj9JiSVS01J+jcgazWq//y4PpGnL+HUSh+kkXlLOtXhBssC+W IWNTYZVFBu8T2Y5F+czeP214vjxd/b+2Ad9Ospv9TOtRN4sioMAewQtSiz2rFG7wt6Zu 2bnmqVnW2m288MvtE3OFeQqEZTWG6FICXbs= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2d4g4q0xdw-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Sep 2017 12:17:19 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB01.TheFacebook.com (192.168.16.11) with Microsoft SMTP Server id 14.3.319.2; Thu, 21 Sep 2017 12:17:18 -0700 Received: by devbig638.prn2.facebook.com (Postfix, from userid 11222) id DCC4F42402EC; Thu, 21 Sep 2017 12:17:16 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Shaohua Li Smtp-Origin-Hostname: devbig638.prn2.facebook.com To: CC: , , Bart Van Assche , Omar Sandoval Smtp-Origin-Cluster: prn2c22 Subject: [PATCH] block: fix a crash caused by wrong API Date: Thu, 21 Sep 2017 12:17:16 -0700 Message-ID: X-Mailer: git-send-email 2.9.5 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-21_05:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP part_stat_show takes a part device not a disk, so we should use part_to_disk. Fix: d62e26b3ffd2(block: pass in queue to inflight accounting) Cc: Bart Van Assche Cc: Omar Sandoval Signed-off-by: Shaohua Li --- block/partition-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partition-generic.c b/block/partition-generic.c index 86e8fe1..88c555d 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -112,7 +112,7 @@ ssize_t part_stat_show(struct device *dev, struct device_attribute *attr, char *buf) { struct hd_struct *p = dev_to_part(dev); - struct request_queue *q = dev_to_disk(dev)->queue; + struct request_queue *q = part_to_disk(p)->queue; unsigned int inflight[2]; int cpu;