summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/fs/path.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/fs/path.inc b/modules/fs/path.inc
index c067049..fd035b5 100644
--- a/modules/fs/path.inc
+++ b/modules/fs/path.inc
@@ -46,7 +46,15 @@ fs_path_isvolatile() {
[ -z "$1" ] && return 2
local _dev _mp
_dev="$(fs_path_getdev "$1")"
- [ -z "$_dev" ] && return 0 # No result, assume tmpfs
+ if [ -z "$_dev" ]; then
+ # not backed by a device in /dev, check for network shares
+ local _mtype="$(fs_path_gettype "$1")"
+ if [ -n "$_mtype" ] && regex_imatch "$_mtype" '^(nfs.?|cifs)$'; then
+ return 1
+ fi
+ # Neither backed by a device nor a cifs/nfs share, assume tmpfs
+ return 0
+ fi
[ "$_dev" = "${_dev#/dev/zram}" ] || return 0 # zram is in RAM, like tmpfs
[ "$_dev" != "${_dev#/dev/mapper/}" ] || return 1 # Doesn't start with /dev/mapper, assume some kind of storage
[ -s "$DM_STATE_FILE" ] || return 2 # No point in continuing