All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Feng <fengli@smartx.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Feng Li <lifeng1519@gmail.com>, Jens Axboe <axboe@kernel.dk>,
	"open list:BLOCK LAYER" <linux-block@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] blk: avoid divide-by-zero with zero granularity
Date: Wed, 13 Jan 2021 10:42:53 +0800	[thread overview]
Message-ID: <CAHckoCwMz2Tqo4ZVkXAmAqfvY1APhqSHDkdS6OPXaqzOMUTh_w@mail.gmail.com> (raw)
In-Reply-To: <yq1pn2a59u3.fsf@ca-mkp.ca.oracle.com>

Yes, Reject the device is the right fix. I will try to send another fix.
By the way, I think this fix is good protection, maybe some other devices
violate this block size constraint.

Divide zero is unacceptable.

Thanks,
Feng Li

Martin K. Petersen <martin.petersen@oracle.com> 于2021年1月13日周三 上午1:48写道:
>
>
> Johannes,
>
> >> I use the nvme-tcp as the host, the target is spdk nvme-tcp target,
> >> and set a wrong block size(i.g. bs=8), then the host prints this oops:
> >
> > I think the better fix here is to reject devices which report a block size
> > small than a sector.
>
> Yep, Linux doesn't support logical block sizes < 512 bytes.
>
> Also, the NVMe spec states:
>
>         "A value smaller than 9 (i.e., 512 bytes) is not supported."
>
> --
> Martin K. Petersen      Oracle Linux Engineering

  reply	other threads:[~2021-01-13  2:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 15:29 [PATCH] blk: avoid divide-by-zero with zero granularity Li Feng
2021-01-12 15:34 ` Feng Li
2021-01-12 15:55 ` [PATCH v2] " Li Feng
2021-01-12 17:10   ` Martin K. Petersen
2021-01-12 17:27     ` Feng Li
2021-01-12 17:36       ` Johannes Thumshirn
2021-01-12 17:46         ` Martin K. Petersen
2021-01-13  2:42           ` Li Feng [this message]
2021-01-12 18:42 ` [PATCH] " kernel test robot
2021-01-12 18:42   ` kernel test robot
2021-01-12 21:49 ` kernel test robot
2021-01-12 21:49   ` kernel test robot
2021-01-12 22:57 ` kernel test robot
2021-01-12 22:57   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHckoCwMz2Tqo4ZVkXAmAqfvY1APhqSHDkdS6OPXaqzOMUTh_w@mail.gmail.com \
    --to=fengli@smartx.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=lifeng1519@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.