From patchwork Sun Apr 19 07:30:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Wise X-Patchwork-Id: 11498195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05EA414B4 for ; Mon, 20 Apr 2020 07:07:09 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 506A62078E for ; Mon, 20 Apr 2020 07:07:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FVeWjz5+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 506A62078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bonedaddy.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587366427; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JyKHCDV5EwdQhjSD6kIrliKnGfWZpwTM1Wx09WKnWf0=; b=FVeWjz5+FWopV5ZVnw2sL8AXXvbf2M932b5CPkIxrUSfc+lPwJ3e9c5noruRk5U6IHZ+0a wal48s5nXJ56831YN3Z2q9D6mtLAul/oHrgGK1VSFHi80Y/8cQLu1mWxxXQXp0wPevJXZ2 SvrnR61U7d4Cs0+sWeRMBjKr70P8+z8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-XzF1B9mGPIinxaQZGWsxVw-1; Mon, 20 Apr 2020 03:07:04 -0400 X-MC-Unique: XzF1B9mGPIinxaQZGWsxVw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28077800D53; Mon, 20 Apr 2020 07:07:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E318058; Mon, 20 Apr 2020 07:06:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A7DD218089CD; Mon, 20 Apr 2020 07:06:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03J7jLdT003003 for ; Sun, 19 Apr 2020 03:45:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1662B17F0; Sun, 19 Apr 2020 07:45:21 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDEFDB17E4 for ; Sun, 19 Apr 2020 07:45:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 662448FF67B for ; Sun, 19 Apr 2020 07:45:19 +0000 (UTC) Received: from master.debian.org (master.debian.org [82.195.75.110]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-eMnEL93MOreCg9OUOlnxzw-1; Sun, 19 Apr 2020 03:45:16 -0400 X-MC-Unique: eMnEL93MOreCg9OUOlnxzw-1 Received: from pabs by master.debian.org with local (Exim 4.92) (envelope-from ) id 1jQ4Q1-00040I-4w; Sun, 19 Apr 2020 07:31:09 +0000 From: Paul Wise To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, linux-kernel@vger.kernel.org Date: Sun, 19 Apr 2020 15:30:23 +0800 Message-Id: <20200419073026.197967-1-pabs3@bonedaddy.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03J7jLdT003003 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 20 Apr 2020 03:06:56 -0400 Cc: Paul Wise Subject: [dm-devel] [PATCH 0/3] dm raid/raid1: enable discard support when any devices support discard X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com This makes dm raid and dm raid1 (mirroring) consistent with md raid, which supports discard when only some of the devices support discard. Another patch will be needed to fix the queue discard limits sysfs files, fixing `fstrim --fstab`, but these patches suffice to fix `fstrim /` and I haven't finished figuring out how the queue discard limits are set yet. Paul Wise (3): dm: add support for targets that allow discard when one device does dm raid: only check for RAID 4/5/6 once during discard support setup dm raid/raid1: enable discard support when any devices support discard drivers/md/dm-cache-target.c | 2 +- drivers/md/dm-clone-target.c | 2 +- drivers/md/dm-log-writes.c | 2 +- drivers/md/dm-raid.c | 21 ++++++++++----------- drivers/md/dm-raid1.c | 1 + drivers/md/dm-table.c | 32 +++++++++++++++++++++----------- drivers/md/dm-thin.c | 8 ++++---- drivers/md/dm-zoned-target.c | 2 +- include/linux/device-mapper.h | 13 ++++++++----- include/uapi/linux/dm-ioctl.h | 4 ++-- 10 files changed, 50 insertions(+), 37 deletions(-)