Revision b8250344
Added by Renato Botelho over 11 years ago
etc/inc/config.lib.inc | ||
---|---|---|
308 | 308 |
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense") |
309 | 309 |
return; |
310 | 310 |
|
311 |
if (!isset($config['system']['nanobsd_force_rw']) && (refcount_reference(1000) > 1)) |
|
312 |
return; |
|
313 |
|
|
314 |
if (isset($config['system']['nanobsd_force_rw']) && is_writable("/")) |
|
311 |
if ((refcount_reference(1000) > 1) && is_writable("/")) |
|
315 | 312 |
return; |
316 | 313 |
|
317 | 314 |
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}"); |
... | ... | |
348 | 345 |
/* Do not trust $g['platform'] since this can be clobbered during factory reset. */ |
349 | 346 |
$platform = trim(file_get_contents("/etc/platform")); |
350 | 347 |
/* do not umount on cdrom or pfSense platforms */ |
351 |
if($platform == "cdrom" or $platform == "pfSense" or isset($config['system']['nanobsd_force_rw']))
|
|
348 |
if($platform == "cdrom" or $platform == "pfSense") |
|
352 | 349 |
return; |
353 | 350 |
|
354 | 351 |
if (refcount_unreference(1000) > 0) |
355 | 352 |
return; |
356 | 353 |
|
354 |
if(isset($config['system']['nanobsd_force_rw'])) |
|
355 |
return; |
|
356 |
|
|
357 | 357 |
if($g['booting']) |
358 | 358 |
return; |
359 | 359 |
|
Also available in: Unified diff
Fix #3235
. diag_nanobsd.php:
. Since conf_mount_ro() is always being called, always call
conf_mount_rw to keep refcount correct
. Do not show refcount_read() return when it's -1
. config.lib.inc
. Increment and decrement refcount even if nanobsd_force_rw is set.
This is necessary to avoid partition being mounted as RO when
nanobsd_force_rw is disabled and any process requested it to be RW