Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp619325ybh; Tue, 21 Jul 2020 03:56:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEd53mqYfjJkInrUduz3sBhagaYATCX/Z7YbIf1qI4W/qJVmqa4oemDc4dkxpK+ixPQSmt X-Received: by 2002:a05:6402:ca1:: with SMTP id cn1mr24820471edb.223.1595328968170; Tue, 21 Jul 2020 03:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595328968; cv=none; d=google.com; s=arc-20160816; b=lM+ftgf5NocGog+j5bNcwDxVD2wgtUVqC53qA3Vk4jL1dae/MvGy7A9Y5RV5MdW3NG SeiK4EPJ0z1gMoVY8pMk7zKgBENaBK0pFLfaZLl84SkpArlYdb77aN5LNWqFLd2KyHhJ 6Ov1OVkY4mmYegOjEuvSDhJAsfWamsqJKmjTmhBegy9VVd5bI5nUiR67Kh7GAxQ/BsNn QfcWvERyIgFUjV0HxkvTkGAT/NKo3Yq1tcfqUaqRkxnPscJXYNzFx1geNoAuTHYlmxr0 o/EyJ+ONuZy/xa81RUu+wgEzfogZ/uvGgPPL+ntnJe1OBZTU+2EyEybowWcUszUYfVTf GjPQ== 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=OLxjLMGXS3SH/S9EEpwVFL+AHIP2haLrD1L8osl1n6I=; b=hJ22yXwbvZ8VhmtyTxoYYAcmBNKY1UJNS4FObqLBtIb9ourfESaioX8vszM6Mnj582 uRn0QXktqb0dfyhMg3DaY0AEmyl7FVowoiZ+ghuyIjjx2VmqLY8dgznikW34AAlZS5xD QjohjWLWX2/0R0Xf04+IGkRWrFacSZnJt+enRLEgB/shrEA/RxkLW4DxaZVVbgVpt5R1 kA70LoT4QYzXMbyB5qQxwhhX+nkT33xWFMX8jZJXyIuborRmLtyTNv0nsDJnDS7N82pG qHX4sBNgTRJbddv0tJpcJrq7eHVzAX+xcOmBlB+qY50FMoJDVufsgboynY1FPaW1ltfr E3CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sxr0Pcb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si11982022edu.151.2020.07.21.03.55.45; Tue, 21 Jul 2020 03:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sxr0Pcb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729426AbgGUKy6 (ORCPT + 99 others); Tue, 21 Jul 2020 06:54:58 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29006 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728097AbgGUKy5 (ORCPT ); Tue, 21 Jul 2020 06:54:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595328896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OLxjLMGXS3SH/S9EEpwVFL+AHIP2haLrD1L8osl1n6I=; b=Sxr0Pcb2A0qnFb6JPtSAgiE0BpyiuTVhnEgP1xRtLQEyxGt6aDz4hUl2lO6e3/NeClkahc K7hFdoKu43un+dlbG1+vt6o/rdq5MMcT/ShVgCmge9L1fcph8jXuFSQw9+XqE0VknG7irk CTJy34afuee8FsO+vEuLLtR/2O6vkhE= 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-166-lJIac-1vO-2kar10RzFp_A-1; Tue, 21 Jul 2020 06:54:52 -0400 X-MC-Unique: lJIac-1vO-2kar10RzFp_A-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 B5ED9107ACCA; Tue, 21 Jul 2020 10:54:49 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DFB276215; Tue, 21 Jul 2020 10:54:36 +0000 (UTC) From: Maxim Levitsky To: linux-kernel@vger.kernel.org Cc: Keith Busch , Josef Bacik , linux-block@vger.kernel.org (open list:BLOCK LAYER), Sagi Grimberg , Jens Axboe , linux-nvme@lists.infradead.org (open list:NVM EXPRESS DRIVER), linux-scsi@vger.kernel.org (open list:SCSI CDROM DRIVER), Tejun Heo , Bart Van Assche , "Martin K. Petersen" , Damien Le Moal , Jason Wang , Maxim Levitsky , Stefan Hajnoczi , Colin Ian King , "Michael S. Tsirkin" , Paolo Bonzini , Ulf Hansson , Ajay Joshi , Ming Lei , linux-mmc@vger.kernel.org (open list:SONY MEMORYSTICK SUBSYSTEM), Christoph Hellwig , Satya Tangirala , nbd@other.debian.org (open list:NETWORK BLOCK DEVICE (NBD)), Hou Tao , Jens Axboe , virtualization@lists.linux-foundation.org (open list:VIRTIO CORE AND NET DRIVERS), "James E.J. Bottomley" , Alex Dubov , Maxim Levitsky Subject: [PATCH 06/10] block: ms_block: use blk_is_valid_logical_block_size Date: Tue, 21 Jul 2020 13:52:35 +0300 Message-Id: <20200721105239.8270-7-mlevitsk@redhat.com> In-Reply-To: <20200721105239.8270-1-mlevitsk@redhat.com> References: <20200721105239.8270-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Maxim Levitsky --- drivers/memstick/core/ms_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index d9ee8e3dc72da..e4df03e10fb46 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -1727,7 +1727,7 @@ static int msb_init_card(struct memstick_dev *card) msb->pages_in_block = boot_block->attr.block_size * 2; msb->block_size = msb->page_size * msb->pages_in_block; - if (msb->page_size > PAGE_SIZE) { + if (!(blk_is_valid_logical_block_size(msb->page_size))) { /* this isn't supported by linux at all, anyway*/ dbg("device page %d size isn't supported", msb->page_size); return -EINVAL; -- 2.26.2