Skip to content

Commit

Permalink
Add cache=none to SMB default mount options
Browse files Browse the repository at this point in the history
This prevents unnecessary log spam
  • Loading branch information
moodeaudio committed May 8, 2023
1 parent d40eb48 commit 5ccf445
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions www/lib-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
if (empty(trim($_POST['mount']['wsize']))) {$_POST['mount']['wsize'] = 65536;}
if (empty(trim($_POST['mount']['options']))) {
if ($_POST['mount']['type'] == 'cifs') {
$_POST['mount']['options'] = "vers=1.0,ro,noserverino,dir_mode=0777,file_mode=0777";
$_POST['mount']['options'] = "vers=1.0,ro,noserverino,cache=none,dir_mode=0777,file_mode=0777";
} else if ($_POST['mount']['type'] == 'nfs') {
$_POST['mount']['options'] = "soft,timeo=10,retrans=1,ro,nolock";
}
Expand Down Expand Up @@ -308,7 +308,7 @@
$_userid_pwd_hide = '';
$_advanced_options_hide = '';
$_rw_size_hide = '';
$_options = 'ro,noserverino,dir_mode=0777,file_mode=0777';
$_options = 'ro,noserverino,cache=none,dir_mode=0777,file_mode=0777';
} else if ($_POST['mounttype'] == 'nfs' || $_POST['mount']['type'] == 'nfs') {
$_protocol = "<option value=\"cifs\">SMB (Samba)</option>\n";
$_protocol .= "<option value=\"nfs\" selected>NFS</option>\n";
Expand All @@ -323,7 +323,7 @@
// CIFS (default))
$_protocol = "<option value=\"cifs\" selected>SMB (Samba)</option>\n";
$_protocol .= "<option value=\"nfs\">NFS</option>\n";
$_options = 'ro,noserverino,dir_mode=0777,file_mode=0777';
$_options = 'ro,noserverino,cache=none,dir_mode=0777,file_mode=0777';
}

$server = isset($_POST['nas_manualserver']) && !empty(trim($_POST['nas_manualserver'])) ? $_POST['nas_manualserver'] : ' '; // Space for select
Expand Down

0 comments on commit 5ccf445

Please sign in to comment.