Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4587735pja; Thu, 21 Nov 2019 22:22:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwC3KcwraoNuux0jfgUVGJYzbB7IohVtZADvVaHdWTIcptXWNmC5c9ujH32ESdLnSby+xBn X-Received: by 2002:a17:906:c789:: with SMTP id cw9mr20399179ejb.40.1574403759103; Thu, 21 Nov 2019 22:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403759; cv=none; d=google.com; s=arc-20160816; b=UOBO2LAvPHsf7GO3555jGPxLifr9IhgYIcue1DkFGGtanEFZzMqQ6Pi9WQ1iMhWu6K uy7XRoYleG9e2LzY55lB5+3LvSAOrSjpKKfuIHxs3bA5zLaB55TW5OVVBrR/2ad+y9cb g9OO53zqKPhpaMhqW70Zh+4TjZHPQPw6Y+my7V60abI/1TppFZPuBFg9+98oBj2QxjCO KFEownUsW/HyUdmR4BipIyisjYdCBGcWFgVHfEaPzNqnWHpILw1HtFEyvbmlA72QhTIC VKQ833Y1yOI02fNTAjD/nizfTP4XW/BK2DWbGFJVoYGLBqj1soNQgHKKEdAJkuvUx4iY 7J3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K7JZebFgW+3cpsWYPntqCDoR3k8VdMmdteI5KscfIoE=; b=nJoaUARA1faL6BbYVaf3U34WZ0F30Eal++1DOul6YIAgAt1OKMQZfO99dlb2SUs89x Wulzgg+uTpQykcjYQv54KD/Q5RXxj4myMw8SJc92M14ofZA+AJFS/XplUJe1z0GtPlz6 4Gz928x6vPzkOjV5UshRhkU9dz+zIXPn9czHKXwuD8eHUG/eQGCJEmNPSddizRCga3/D Ssh2rz99vaJ0ZmhhcS5XvtsHxPRkmCTCbzouYyac00rLW2qNU3+jDnSQ+H5uadZu2gBP qDtnOLIIh41xQcm/skLHVnJLj82j7vl7byFCMaNazlSdzHq4+rBOnJBa6IIZUd25XgRU qvCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rVGilCmF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si4301287edc.4.2019.11.21.22.22.15; Thu, 21 Nov 2019 22:22:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rVGilCmF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728678AbfKVGUO (ORCPT + 99 others); Fri, 22 Nov 2019 01:20:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:58612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728659AbfKVFwp (ORCPT ); Fri, 22 Nov 2019 00:52:45 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA5BB20721; Fri, 22 Nov 2019 05:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401964; bh=zYB41gfG09mqdRPWxWlUgH4vOV0svqU0ru6XZw2f+fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVGilCmF8MINlzYUHOHTFM8xcg4SCnmbr7l8oY0D2MikRnwsMTZ8k3/nX4nMYT7m5 D8JBeKovtVQRK4MhfxM7zz9tesdm7Ohy3cAr361BVNkCJTX8+ny6NzFfu0VmRLr/Ra mMcWxR+GskYdMV/l26tvBmBurjWVjjp5c6cNXkIw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jan Kara , Johannes Thumshirn , Jens Axboe , Sasha Levin Subject: [PATCH AUTOSEL 4.19 185/219] blktrace: Show requests without sector Date: Fri, 22 Nov 2019 00:48:37 -0500 Message-Id: <20191122054911.1750-178-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kara [ Upstream commit 0803de78049fe1b0baf44bcddc727b036fb9139b ] Currently, blktrace will not show requests that don't have any data as rq->__sector is initialized to -1 which is out of device range and thus discarded by act_log_check(). This is most notably the case for cache flush requests sent to the device. Fix the problem by making blk_rq_trace_sector() return 0 for requests without initialized sector. Reviewed-by: Johannes Thumshirn Signed-off-by: Jan Kara Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- include/linux/blktrace_api.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 8804753805ac5..7bb2d8de9f308 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -116,7 +116,13 @@ extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes); static inline sector_t blk_rq_trace_sector(struct request *rq) { - return blk_rq_is_passthrough(rq) ? 0 : blk_rq_pos(rq); + /* + * Tracing should ignore starting sector for passthrough requests and + * requests where starting sector didn't get set. + */ + if (blk_rq_is_passthrough(rq) || blk_rq_pos(rq) == (sector_t)-1) + return 0; + return blk_rq_pos(rq); } static inline unsigned int blk_rq_trace_nr_sectors(struct request *rq) -- 2.20.1