mbox series

[OpenWrt-Devel,fstools,0/2] block(d): remove remaining files if they exist

Message ID 20191228210722.1407-1-zajec5@gmail.com
Headers show
Series block(d): remove remaining files if they exist | expand

Message

Rafał Miłecki Dec. 28, 2019, 9:07 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

I noticed that rebooting with devices mounted can result in:
1) Leaving directories in /mnt/ when not using autofs
2) Leaving symlinks in /mnt/ when using autofs

They can cause mounting errors on further attempts.

With mountd this problem didn't exist due to using /tmp/mounts/ instead
of /mnt/. With block(d) we have to find some solution.

This patches takes care of removing files that can cause mounting or
symlink-ing errors. Worth implementing may be also a /mnt/ cleanup done
at boot/init time.

Rafał Miłecki (2):
  block: remove mount target file if it's a link
  blockd: remove symlink linkpath file if it's a dir or link

 block.c  | 3 +++
 blockd.c | 7 +++++++
 2 files changed, 10 insertions(+)