On Mon, Apr 07, 2025 at 11:14:34AM +0800, Ming Lei wrote: > On Sun, Apr 06, 2025 at 11:17:05PM +0300, Jared Holzman wrote: > > Hi Ming, > > > > On 05/04/2025 5:51, Ming Lei wrote: > > > External email: Use caution opening links or attachments > > > > > > > > > Hello Jared, > > > > > > On Thu, Apr 03, 2025 at 12:37:11PM +0000, Jared Holzman wrote: > > > > Apologies if this is a dup, but I am not seeing the original mail on the mailing list archive. > > > I guess it is because the patch is sent as html, instead of plain test, > > > please follow the patch submission guide: > > > > > > https://www.kernel.org/doc/Documentation/process/submitting-patches.rst > > > > Sorry about that, I originally sent the mail using git send-mail, but our > > internal smtp relay does not support outside addresses. I then tried > > forwarding it from Outlook and it decided to add HTML without telling me. > > > > I'm using Thunderbird now, so hopefully it will be in plain-text as > > required. > > > > > > ________________________________ > > > > From: Jared Holzman <jholzman@xxxxxxxxxx> > > > > Sent: Monday, 31 March 2025 4:54 PM > > > > To: linux-block@xxxxxxxxxxxxxxx <linux-block@xxxxxxxxxxxxxxx> > > > > Cc: ming.lei@xxxxxxxxxx <ming.lei@xxxxxxxxxx>; Omri Mann <omri@xxxxxxxxxx>; Ofer Oshri <ofer@xxxxxxxxxx>; Omri Levi <omril@xxxxxxxxxx>; Jared Holzman <jholzman@xxxxxxxxxx> > > > > Subject: [PATCH] ublk: Add UBLK_U_CMD_SET_SIZE > > > > > > > > From: Omri Mann <omri@xxxxxxxxxx> > > > > > > > > Currently ublk only allows the size of the ublkb block device to be > > > > set via UBLK_CMD_SET_PARAMS before UBLK_CMD_START_DEV is triggered. > > > > > > > > This does not provide support for extendable user-space block devices > > > > without having to stop and restart the underlying ublkb block device > > > > causing IO interruption. > > > The requirement is reasonable. > > > > > > > This patch adds a new ublk command UBLK_U_CMD_SET_SIZE to allow the > > > > ublk block device to be resized on-the-fly. > > > Looks CMD_SET_SIZE is not generic enough, maybe UBLK_CMD_UPDATE_PARAMS > > > can be added for support any parameter update by allowing to do it > > > when device is in LIVE state. > > > > That's fine, but we'd rather not take on the burden of verifying all of > > ublk_params to see which ones can be safely changed on-the-fly. > > > > Would it be reasonable to have UBLK_CMD_UPDATE_PARAMS accept a different > > struct "ublk_param_update" which contains only the parameters that can be > > updated in the LIVE state and will include only max_sectors for now? > > > > Alternatively if you know off the top of your head which parameters can be > > easily changed on-the-fly and we will add only those. > > Fair enough, updating 'dev_sectors' should be generic enough, and it looks > fine to add UBLK_U_CMD_SET_SIZE. Also UBLK_U_CMD_SET_SIZE may be renamed as UBLK_U_CMD_UPDATE_SIZE. Thanks, Ming