All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "dracut-functions: $_x should exist, no need to test."
@ 2012-08-01  3:23 Chao Wang
       [not found] ` <1343791422-8391-1-git-send-email-chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Wang @ 2012-08-01  3:23 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: wangchao19890207-Re5JQEeQqe8AvxtiuMwx3w

This reverts commit b2d225a6698607bbcb73b6e6d12fbfc5be014102.

When there's no /sys/dev/block/$2/slaves/*/dev/ exists, $_x will
be assigned with '/sys/dev/block/$2/slaves/*/dev/', this is invalid.
That commit will lead to some warn msg like:
cat: /sys/dev/block/8:16/slaves/*/dev: No such file or directory
cat: /sys/dev/block/8:32/slaves/*/dev: No such file or directory
---
 dracut-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dracut-functions.sh b/dracut-functions.sh
index a299bbb..2ad8f4a 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -423,6 +423,7 @@ check_block_and_slaves() {
     fi
     [[ -d /sys/dev/block/$2/slaves ]] || return 1
     for _x in /sys/dev/block/$2/slaves/*/dev; do
+        [[ -f $_x ]] || continue
         check_block_and_slaves $1 $(cat "$_x") && return 0
     done
     return 1
-- 
1.7.11.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-02 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01  3:23 [PATCH] Revert "dracut-functions: $_x should exist, no need to test." Chao Wang
     [not found] ` <1343791422-8391-1-git-send-email-chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-01 20:44   ` Michal Soltys
     [not found]     ` <5019953D.6080203-R61QfzASbfY@public.gmane.org>
2012-08-02 12:29       ` Wang Chao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.