Skip to content

Commit 9997d6d

Browse files
authored
Merge pull request #2460 from AkihiroSuda/fix-9p
boot/04-persistent-data-volume.sh: fix 9p cache options
2 parents 917398d + ab6fd8c commit 9997d6d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ for DIR in ${DATADIRS}; do
3232
[ "${MNTTYPE}" = "ext4" ] && continue
3333
[ "${MNTTYPE}" = "tmpfs" ] && continue
3434
MNTOPTS="$(echo "${LINE}" | awk '{print $4}')"
35+
if [ "${MNTTYPE}" = "9p" ]; then
36+
# https://github.com/torvalds/linux/blob/v6.6/fs/9p/v9fs.h#L61
37+
MNTOPTS="$(echo "${MNTOPTS}" | sed -e 's/cache=8f,/cache=fscache,/; s/cache=f,/cache=loose,/; s/cache=5,/cache=mmap,/; s/cache=1,/cache=readahead,/; s/cache=0,/cache=none,/')"
38+
fi
3539
# Before mv, unmount filesystems (virtiofs, 9p, etc.) below "${DIR}", otherwise host mounts will be wiped out
3640
# https://github.com/rancher-sandbox/rancher-desktop/issues/6582
3741
umount "${MNTPNT}" || exit 1

0 commit comments

Comments
 (0)