From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 4BCBA1FF0E6 for ; Fri, 24 Jul 2026 11:19:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B52B721493; Fri, 24 Jul 2026 11:19:15 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 24 Jul 2026 11:19:09 +0200 Message-Id: To: "Elias Huhsovitz" , From: "Max R. Carrara" Subject: Re: [PATCH manager v2] fix #6855: ui: storage: add mount options field for nfs amd smb/cifs X-Mailer: aerc 0.18.2-0-ge037c095a049 References: <20260723150316.168440-1-e.huhsovitz@proxmox.com> In-Reply-To: <20260723150316.168440-1-e.huhsovitz@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784884719440 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.033 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ECNSZRKWM2B4DH6CEVDNFAJZKIZEHEYQ X-Message-ID-Hash: ECNSZRKWM2B4DH6CEVDNFAJZKIZEHEYQ X-MailFrom: m.carrara@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Jul 23, 2026 at 5:03 PM CEST, Elias Huhsovitz wrote: > Add a text field for custom mount options to the NFS and CIFS > storage configuration dialogs. This allows users to configure > advanced mount parameters (like 'nconnect', 'rdma', or 'seal') > directly via the web interface, without needing to use the CLI > or manually edit storage.cfg. > > When nfs version or mount option is being changed: > Display a hint to the user that changes will require > remounting the storage to take effect. > > Reduce the usage of legacy JS practices, such as 'var' & "+ string > concatination" in affected functions. > > Signed-off-by: Elias Huhsovitz > --- > > v1: https://lore.proxmox.com/pve-devel/20260721121334.115027-1-e.huhsovit= z@proxmox.com/ > > This v2 patch addresses comments made in [1]. Thanks for the refresh! Comments inline -- everything works great! > > changes v1->v2: > - add dynamic UI hint when user changes mount config or nfs version > to inform them them that a remount is required for changes > to take effect. Tested this and works as advertised -- the hint is not intrusive at all and matches the style of the existing SaVC hint. > - update emptyText placeholders to align with existing PVE UI > conventions Also looks neat. > > comments that have not been implemented: > - reboot after passsing invalid option: > Regarding the concern about correcting an invalid option > (e.g., port=3D42069) and the storage failing to reconnect: > I attempted to reproduce this behavior in my test environment but was u= nable > to do so. > In my testing, correcting the option and saving successfully updated th= e > configuration, and the storage reconnected after a few seconds. > > If this auto-reconnection behavior is indeed a reproducible edge case i= n > specific scenarios, I believe it would be best addressed in a separate, > dedicated patch. > > - automatic re-mount: > I made the deliberate decision not to implement automatic re-mounting u= pon > configuration changes in this patch. Automatically triggering a remount= could > introduce unnecessary complexity and risk disrupting active I/O operati= ons > (reads/writes) if a user modifies options while the storage is currentl= y in > use by running guests or backup jobs. > > [1] https://lore.proxmox.com/pve-devel/DK4A5D7GDH1S.1WY2YTP8AF8MG@proxmox= .com/ Thanks for checking all of this out in-depth. Most of the things I mentioned were mostly suggestions -- I think the solution with the hint is indeed the best, especially now that I've seen it. It doesn't break anything and tells the user transparently what's necessary for the new mount options to take effect. Regarding the auto-reconnection issue I had encountered: This was probably just a fluke / misconception on my part, as I now noticed that the storage status icons remain with a "?" if I reboot with invalid mount options specified. When correcting the mount options, the storage does indeed reconnect correctly after a few seconds. Though, in my case, the "?" icons in the UI remain, so that's most likely a different issue. Restarting `pveproxy` makes the correct icons pop up in the UI again, so that issue seems to be orthogonal to this patch. In any case, the patch works as advertised -- the thing with the duplicate options can be implemented if users actually run into it, which I think is very unlikely. (And also, it's trivial to implement anyway.) Great work! :D Consider: Reviewed-by: Max R. Carrara Tested-by: Max R. Carrara > > www/manager6/storage/CIFSEdit.js | 70 +++++++++++++++++-- > www/manager6/storage/NFSEdit.js | 111 +++++++++++++++++++++++++------ > 2 files changed, 154 insertions(+), 27 deletions(-) > > diff --git a/www/manager6/storage/CIFSEdit.js b/www/manager6/storage/CIFS= Edit.js > index 5fe3fefe..313bc7ff 100644 > --- a/www/manager6/storage/CIFSEdit.js > +++ b/www/manager6/storage/CIFSEdit.js > @@ -121,7 +121,7 @@ Ext.define('PVE.storage.CIFSInputPanel', { > onlineHelp: 'storage_cifs', > > onGetValues: function (values) { > - let me =3D this; > + const me =3D this; > > if (values.password?.length =3D=3D=3D 0) { > delete values.password; > @@ -133,11 +133,39 @@ Ext.define('PVE.storage.CIFSInputPanel', { > delete values.subdir; > } > > + if (values.options) { > + values.options =3D values.options > + .split(',') > + .map((opt) =3D> opt.trim()) > + .filter((opt, index, self) =3D> opt !=3D=3D '' && self.i= ndexOf(opt) =3D=3D=3D index) > + .join(','); > + } > + > + if (!values.options) { > + delete values.options; > + if (!me.isCreate) { > + values.delete =3D values.delete ? `${values.delete},opti= ons` : 'options'; > + } > + } > + > return me.callParent([values]); > }, > > + setValues: function (values) { > + const me =3D this; > + > + me.originalOptions =3D values.options || ''; > + > + me.callParent([values]); > + > + const hint =3D me.down('#mountOptionsHint'); > + if (hint) { > + hint.setHidden(true); > + } > + }, > + > initComponent: function () { > - var me =3D this; > + const me =3D this; > > me.column1 =3D [ > { > @@ -149,7 +177,7 @@ Ext.define('PVE.storage.CIFSInputPanel', { > listeners: { > change: function (f, value) { > if (me.isCreate) { > - let exportField =3D me.down('field[name=3Dsh= are]'); > + const exportField =3D me.down('field[name=3D= share]'); > exportField.setServer(value); > } > }, > @@ -166,7 +194,7 @@ Ext.define('PVE.storage.CIFSInputPanel', { > if (!me.isCreate) { > return; > } > - var exportField =3D me.down('field[name=3Dshare]= '); > + const exportField =3D me.down('field[name=3Dshar= e]'); > exportField.setUsername(value); > }, > }, > @@ -181,7 +209,7 @@ Ext.define('PVE.storage.CIFSInputPanel', { > minLength: 1, > listeners: { > change: function (f, value) { > - let exportField =3D me.down('field[name=3Dshare]= '); > + const exportField =3D me.down('field[name=3Dshar= e]'); > exportField.setPassword(value); > }, > }, > @@ -213,7 +241,7 @@ Ext.define('PVE.storage.CIFSInputPanel', { > listeners: { > change: function (f, value) { > if (me.isCreate) { > - let exportField =3D me.down('field[name=3Dsh= are]'); > + const exportField =3D me.down('field[name=3D= share]'); > exportField.setDomain(value); > } > }, > @@ -229,6 +257,36 @@ Ext.define('PVE.storage.CIFSInputPanel', { > }, > ]; > > + me.advancedColumn2 =3D [ > + { > + xtype: 'textfield', > + name: 'options', > + fieldLabel: gettext('Mount Options'), > + emptyText: `${gettext('Example')}: rdma, seal`, > + allowBlank: true, > + deleteEmpty: !me.isCreate, > + listeners: { > + change: function (field, newValue) { > + const hint =3D me.down('#mountOptionsHint'); > + if (hint) { > + hint.setHidden((newValue || '') =3D=3D=3D me= .originalOptions); > + } > + }, > + }, > + }, > + ]; > + > + me.advancedColumnB =3D me.advancedColumnB || []; > + me.advancedColumnB.unshift({ > + xtype: 'displayfield', > + itemId: 'mountOptionsHint', > + userCls: 'pmx-hint', > + hidden: true, > + value: gettext( > + 'Changes to mount options require remounting the storage= to take effect.', > + ), > + }); > + > me.callParent(); > }, > }); > diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEd= it.js > index 72db156f..c4756fe8 100644 > --- a/www/manager6/storage/NFSEdit.js > +++ b/www/manager6/storage/NFSEdit.js > @@ -57,7 +57,6 @@ Ext.define('PVE.storage.NFSScan', { > me.callParent(); > }, > }); > - > Ext.define('PVE.storage.NFSInputPanel', { > extend: 'PVE.panel.StorageBase', > > @@ -66,25 +65,31 @@ Ext.define('PVE.storage.NFSInputPanel', { > options: [], > > onGetValues: function (values) { > - var me =3D this; > - > - var i; > - var res =3D []; > - for (i =3D 0; i < me.options.length; i++) { > - let item =3D me.options[i]; > - if (!item.match(/^vers=3D(.*)$/)) { > - res.push(item); > - } > + const me =3D this; > + const res =3D []; > + > + if (values.options && values.options.trim() !=3D=3D '') { > + const opts =3D values.options.split(','); > + opts.forEach((opt) =3D> { > + const cleanOpt =3D opt.trim(); > + if (cleanOpt !=3D=3D '' && !cleanOpt.match(/^vers=3D(.*)= $/) && !res.includes(cleanOpt)) { > + res.push(cleanOpt); > + } > + }); > } > + > if (values.nfsversion && values.nfsversion !=3D=3D '__default__'= ) { > - res.push('vers=3D' + values.nfsversion); > + res.push(`vers=3D${values.nfsversion}`); > } > + > delete values.nfsversion; > - values.options =3D res.join(','); > - if (values.options =3D=3D=3D '') { > + > + if (res.length > 0) { > + values.options =3D res.join(','); > + } else { > delete values.options; > if (!me.isCreate) { > - values.delete =3D 'options'; > + values.delete =3D values.delete ? `${values.delete},opti= ons` : 'options'; > } > } > > @@ -92,21 +97,42 @@ Ext.define('PVE.storage.NFSInputPanel', { > }, > > setValues: function (values) { > - var me =3D this; > + const me =3D this; > + > if (values.options) { > - me.options =3D values.options.split(','); > - me.options.forEach(function (item) { > - var match =3D item.match(/^vers=3D(.*)$/); > + const opts =3D values.options.split(',').map((item) =3D> ite= m.trim()); > + > + opts.forEach((item) =3D> { > + const match =3D item.match(/^vers=3D(.*)$/); > if (match) { > values.nfsversion =3D match[1]; > } > }); > + > + // Filter out "vers=3D..." and empty strings > + const otherOptions =3D opts.filter( > + (item, index, self) =3D> item !=3D=3D '' && !item.match(= /^vers=3D(.*)$/), > + ); > + values.options =3D otherOptions.join(','); > + > + if (values.options =3D=3D=3D '') { > + delete values.options; > + } > + } > + > + me.originalOptions =3D values.options || ''; > + me.originalNfsVersion =3D values.nfsversion || '__default__'; > + > + me.callParent([values]); > + > + const hint =3D me.down('#mountOptionsHint'); > + if (hint) { > + hint.setHidden(true); > } > - return me.callParent([values]); > }, > > initComponent: function () { > - var me =3D this; > + const me =3D this; > > me.column1 =3D [ > { > @@ -118,7 +144,7 @@ Ext.define('PVE.storage.NFSInputPanel', { > listeners: { > change: function (f, value) { > if (me.isCreate) { > - let exportField =3D me.down('field[name=3Dex= port]'); > + const exportField =3D me.down('field[name=3D= export]'); > exportField.setServer(value); > exportField.setValue(''); > } > @@ -143,6 +169,26 @@ Ext.define('PVE.storage.NFSInputPanel', { > ]; > > me.advancedColumn2 =3D [ > + { > + xtype: 'textfield', > + name: 'options', > + fieldLabel: gettext('Mount Options'), > + emptyText: `${gettext('Example')}: nconnect=3D4, soft`, > + allowBlank: true, > + deleteEmpty: !me.isCreate, > + listeners: { > + change: function (field, newValue) { > + const hint =3D me.down('#mountOptionsHint'); > + if (hint) { > + const currentVersion =3D > + me.down('field[name=3Dnfsversion]')?.get= Value() || '__default__'; > + const isOptionsChanged =3D (newValue || '') = !=3D=3D me.originalOptions; > + const isVersionChanged =3D currentVersion != =3D=3D me.originalNfsVersion; > + hint.setHidden(!(isOptionsChanged || isVersi= onChanged)); > + } > + }, > + }, > + }, > { > xtype: 'proxmoxKVComboBox', > fieldLabel: gettext('NFS Version'), > @@ -156,9 +202,32 @@ Ext.define('PVE.storage.NFSInputPanel', { > ['4.1', '4.1'], > ['4.2', '4.2'], > ], > + listeners: { > + change: function (field, newValue) { > + const hint =3D me.down('#mountOptionsHint'); > + if (hint) { > + const currentOptions =3D me.down('field[name= =3Doptions]')?.getValue() || ''; > + const isOptionsChanged =3D currentOptions != =3D=3D me.originalOptions; > + const isVersionChanged =3D > + (newValue || '__default__') !=3D=3D me.o= riginalNfsVersion; > + hint.setHidden(!(isOptionsChanged || isVersi= onChanged)); > + } > + }, > + }, > }, > ]; > > + me.advancedColumnB =3D me.advancedColumnB || []; > + me.advancedColumnB.unshift({ > + xtype: 'displayfield', > + itemId: 'mountOptionsHint', > + userCls: 'pmx-hint', > + hidden: true, > + value: gettext( > + 'Changes to mount options require remounting the storage= to take effect.', > + ), > + }); > + > me.callParent(); > }, > });