Bug 218569 - Race condition in kernel-2.6.spec
Summary: Race condition in kernel-2.6.spec
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
(Show other bugs)
Version: 6
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-06 03:42 UTC by H.J. Lu
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-19 03:51:38 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description H.J. Lu 2006-12-06 03:42:58 UTC
1.2860 kernel-2.6.spec for FC6 has

 # We already have a vanilla dir.
  cd kernel-%{kversion}
  if [ -d linux-%{kversion}.%{_target_cpu} ]; then
     # Just in case we ctrl-c'd a prep already
     rm -rf deleteme
     # Move away the stale away, and delete in background.
     mv linux-%{kversion}.%{_target_cpu} deleteme
     rm -rf deleteme &
  fi

...

while [ -d deleteme ];
do
        sleep 1
done

On my Core 2 Duo machine, I got

+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
/bin/chmod: cannot access `./deleteme/drivers/mmc/mmc_block.mod.o': No such file
or directory
...

I don't think the working directory of

while [ -d deleteme ];
do
        sleep 1
done

is correct.

Comment 1 H.J. Lu 2006-12-06 04:57:14 UTC
Does this patch look right?

--- /export/redhat/import/fedora/core/kernel/FC-6/kernel-2.6.spec      
2006-12-05 12:45:10.000000000 -0800
+++ kernel-2.6.spec     2006-12-05 20:56:07.000000000 -0800
@@ -1298,7 +1298,7 @@ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVE
 # trick still hasn't completed, and things go bang at this point
 # when find traverses into directories that get deleted.
 # So we serialise until the dir has gone away.
-while [ -d deleteme ];
+while [ -d ../deleteme ];
 do
        sleep 1
 done


Comment 2 H.J. Lu 2006-12-06 13:46:51 UTC
(In reply to comment #1)
> Does this patch look right?
> 
> --- /export/redhat/import/fedora/core/kernel/FC-6/kernel-2.6.spec      
> 2006-12-05 12:45:10.000000000 -0800
> +++ kernel-2.6.spec     2006-12-05 20:56:07.000000000 -0800
> @@ -1298,7 +1298,7 @@ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVE
>  # trick still hasn't completed, and things go bang at this point
>  # when find traverses into directories that get deleted.
>  # So we serialise until the dir has gone away.
> -while [ -d deleteme ];
> +while [ -d ../deleteme ];
>  do
>         sleep 1
>  done
> 

This patch works for me.


Note You need to log in before you can comment on or make changes to this bug.