Bug 218569 - Race condition in kernel-2.6.spec
Race condition in kernel-2.6.spec
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-05 22:42 EST by H.J. Lu
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description H.J. Lu 2006-12-05 22:42:58 EST
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-05 23:57:14 EST
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 08:46:51 EST
(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.