Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4309714ybl; Sat, 21 Dec 2019 04:16:32 -0800 (PST) X-Google-Smtp-Source: APXvYqySMJiaVwgyVaBZFhRwKTngBIePkqYefnDlOHh1zy5diIBc42KAjafx2x/E+wt0VvxNhO+l X-Received: by 2002:a9d:461b:: with SMTP id y27mr22424007ote.280.1576930592479; Sat, 21 Dec 2019 04:16:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576930592; cv=none; d=google.com; s=arc-20160816; b=pmItC30E055P7VkY4tI2naKYEJbDvx7Z87pdes8QmFhFmGAdoDgs3N4hTgfAOTBrj5 6d3X7jqMDFHiilQimAEalNWrPFQRX2TB8+zjtKKpH8NKBxYE2fCdTZvcoBatPTluxBkp lapACSQCj9T8rOy/YI8pNW75It04ccZTrna+vdOJOaY22CB8x/jeGJDHMgXLJjzbPd+Q uz78TMi9A5GHAlf812p/Q88+yrO7lFoy7rX9CHl11bByK+ucLf/AzUQKIAfzM+id2vxD 7FRLPyNPjhlGwkrhpncPv1whA8iMAY1nWkokIcWTgrxTV7HFxd51Hq0AQ1sJTWNaLAwy eJsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tXmIZJq2DpgBkSm7Q1HSGR59jROvvJvQbOQxJTbd7JY=; b=CKtjnBrh9+bpZpE95KuRc0WKdTiybD+9lFM4DLJwW+CQXpEsuQ5TXL4v9vXbwoGqG+ ptA8mS3VK/CuAsXUDsGIVqnLshWuEPqJ6KcsHaVl/GqgC5JyNYpG0kLKm9r6AOp3Qg3X JZjRcjm5KUQu4G/O5TOoh9i4yzQAQoZiebENjwDIt5glzwkdvSusX2RlqyKrlEXhy3EM bokSMFgSpneu2dyELveHsWnKUUj2OF/ZYaTD7XLEAOVD9ZuroUD8WuZB1iqV5hRw9oDa NY/5NIKJuN8UZvxunSqdc/YIc2y5uF5yvzQ0yGp90enGG9PcgCLVQstM1rkCsVIJiJQi IC6w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v28si5504840ote.55.2019.12.21.04.16.18; Sat, 21 Dec 2019 04:16:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfLULyW (ORCPT + 99 others); Sat, 21 Dec 2019 06:54:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:33248 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbfLULyW (ORCPT ); Sat, 21 Dec 2019 06:54:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D3DCEAAC3; Sat, 21 Dec 2019 11:54:20 +0000 (UTC) Date: Sat, 21 Dec 2019 12:54:19 +0100 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Jens Axboe Subject: Re: [PATCH] scsi: blacklist: add VMware ESXi cdrom - broken tray emulation Message-ID: <20191221115419.GN4113@kitsune.suse.cz> References: <20191217180840.9414-1-msuchanek@suse.de> <20191219143422.GJ4113@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 06:31:12PM -0500, Martin K. Petersen wrote: > > Michal, > > >> Please don't introduce a blist flag to work around deficiencies in the > >> matching interface. I suggest you tweak the matching functions so they > >> handle a NULL vendor string correctly. > > > > I don't think that will work with the interface for dynamically adding > > entries through sysfs. > > Please make it work :) > > There's nothing conceptually wrong with being able to do: > > echo ":Model:Flags" > /proc/scsi/device_info > > We keep running into issues where the same device needs to be listed > many times because it gets branded by different vendors. Actually the flag is really needed. The vendor string is a field of specific length, not a pointer. This makes sense because the vendor string is fixed length. The code adding the blacklist entries cannot handle NULL, and the matching code works with char array already. What can be done differently is stop space-padding the values and instead match the length of the string as provided. This will however cause API break. Currently short entries are space-padded to match exactly the provided vendor string. If we change the match to only the provided string length it will potentially match and blacklist additional devices. If a flag is required to trigger the prefix matching it can be used instead of the flag that disables vendor matching with empty vendor string. Thanks Michal