summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorDaniel Dickinson <crazycshore@gmail.com>2010-07-12 16:35:39 +0000
committerDaniel Dickinson <crazycshore@gmail.com>2010-07-12 16:35:39 +0000
commit117590a2ce8ffc8161aafce06164e02d1f34157e (patch)
tree99f5663e810879156a59104f8b07e4dac9dfc7a6 /package
parentb6d521ea33df33a44461a0f394c6b9811ae2ca5d (diff)
downloadmtk-20170518-117590a2ce8ffc8161aafce06164e02d1f34157e.zip
mtk-20170518-117590a2ce8ffc8161aafce06164e02d1f34157e.tar.gz
mtk-20170518-117590a2ce8ffc8161aafce06164e02d1f34157e.tar.bz2
block-mount: Fixed two bugs in fstab.init. /etc/fstab was used where /tmp/fstab should have been, and locking was insufficiently careful and was such that it could result in deadlock when hotplug was in use.
SVN-Revision: 22148
Diffstat (limited to 'package')
-rw-r--r--package/block-mount/files/fstab.init10
1 files changed, 7 insertions, 3 deletions
diff --git a/package/block-mount/files/fstab.init b/package/block-mount/files/fstab.init
index d755ecc..fdcd4f5 100644
--- a/package/block-mount/files/fstab.init
+++ b/package/block-mount/files/fstab.init
@@ -41,9 +41,13 @@ do_swapoff() {
start() {
config_load fstab
mkdir -p /var/lock
- lock /var/lock/fstab.lck
- echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /etc/fstab
- lock -u /var/lock/fstab.lck
+ lock -w /var/lock/fstab.lck && {
+ lock /var/lock/fstab.lck
+ [ -e /tmp/fstab ] || {
+ echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /tmp/fstab
+ }
+ lock -u /var/lock/fstab.lck
+ }
config_foreach do_swapon swap
config_foreach do_mount mount
}