[OpenWrt-Devel] [PATCH] start selected services after block mount

2011-02-18 Thread Lee Essen
This patch adds /etc/hotplug.d/block/60-services that will look for "service" entries in /etc/config/fstab against a given mount and start them once the mount has been completed by the hotplug system. This is to solve the problem of usb devices being mounted after most of the rc system has completed, therefore any services that are intended to write to a mounted filesystem either fail or end up writing to the mount point prior to the mount.An example config:config 'mount'	option 'enabled' '1'	option 'device' '/dev/sda1'	option 'target' '/site'	option 'fstype' 'ext4'	option 'options' 'rw,noatime'	list 'service' 'syslog-ng'	list 'service' 'collectd'Signed-off-by: Lee Essen 

block_mount_svcs.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Fwd: [PATCH] ATM, Solos PCI ADSL2+: Don't deref NULL pointer if net_ratelimit() and alloc_skb() interact badly.

2011-02-18 Thread Philip Prindeville

from netdev... applied 2/13/11.

 Original Message 
Subject:[PATCH] ATM, Solos PCI ADSL2+: Don't deref NULL pointer if 
net_ratelimit() and alloc_skb() interact badly.
Date:   Sun, 13 Feb 2011 21:49:32 +0100 (CET)
From:   Jesper Juhl 
To: linux-ker...@vger.kernel.org
CC: Chas Williams , linux-atm-gene...@lists.sourceforge.net, 
net...@vger.kernel.org, Nathan Williams , David Woodhouse 
, Treker Chen 



If alloc_skb() fails to allocate memory and returns NULL then we want to
return -ENOMEM from drivers/atm/solos-pci.c::popen() regardless of the
value of net_ratelimit(). The way the code is today, we may not return if
net_ratelimit() returns 0, then we'll proceed to pass a NULL pointer to
skb_put() which will blow up in our face.
This patch ensures that we always return -ENOMEM on alloc_skb() failure
and only let the dev_warn() be controlled by the value of net_ratelimit().

Signed-off-by: Jesper Juhl
---
 solos-pci.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 73fb1c4..25ef1a4 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -866,8 +866,9 @@ static int popen(struct atm_vcc *vcc)
}

skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
-   if (!skb&&  net_ratelimit()) {
-   dev_warn(&card->dev->dev, "Failed to allocate sk_buff in 
popen()\n");
+   if (!skb) {
+   if (net_ratelimit())
+   dev_warn(&card->dev->dev, "Failed to allocate sk_buff in 
popen()\n");
return -ENOMEM;
}
header = (void *)skb_put(skb, sizeof(*header));


--
Jesper Juhl http://www.chaosbits.net/
Plain text mails only, please.
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel