Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 146366 Details for
Bug 212882
IOError 13: Permission Denied when portage is shared via CIFS, and distlocks is used
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
also handle ENOENT from fstat calls
lock-cifs.patch (text/plain), 1.66 KB, created by
Zac Medico
on 2008-03-17 02:33:41 UTC
(
hide
)
Description:
also handle ENOENT from fstat calls
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2008-03-17 02:33:41 UTC
Size:
1.66 KB
patch
obsolete
>Index: pym/portage_locks.py >=================================================================== >--- pym/portage_locks.py (revision 9417) >+++ pym/portage_locks.py (working copy) >@@ -79,7 +79,7 @@ > except IOError, e: > if "errno" not in dir(e): > raise >- if e.errno == errno.EAGAIN: >+ if e.errno in (errno.EACCES, errno.EAGAIN): > # resource temp unavailable; eg, someone beat us to the lock. > if waiting_msg is None: > if isinstance(mypath, int): >@@ -111,7 +111,7 @@ > > > if type(lockfilename) == types.StringType and \ >- myfd != HARDLINK_FD and os.fstat(myfd).st_nlink == 0: >+ myfd != HARDLINK_FD and _fstat_nlink(myfd) == 0: > # The file was deleted on us... Keep trying to make one... > os.close(myfd) > portage_util.writemsg("lockfile recurse\n",1) >@@ -122,6 +122,22 @@ > portage_util.writemsg(str((lockfilename,myfd,unlinkfile))+"\n",1) > return (lockfilename,myfd,unlinkfile,locking_method) > >+def _fstat_nlink(fd): >+ """ >+ @param fd: an open file descriptor >+ @type fd: Integer >+ @rtype: Integer >+ @return: the current number of hardlinks to the file >+ """ >+ try: >+ return os.fstat(fd).st_nlink >+ except EnvironmentError, e: >+ if e.errno == errno.ENOENT: >+ # Some filesystems such as CIFS return >+ # ENOENT which means st_nlink == 0. >+ return 0 >+ raise >+ > def unlockfile(mytuple): > import fcntl > >@@ -167,7 +183,7 @@ > # We won the lock, so there isn't competition for it. > # We can safely delete the file. > portage_util.writemsg("Got the lockfile...\n",1) >- if os.fstat(myfd).st_nlink == 1: >+ if _fstat_nlink(myfd) == 1: > os.unlink(lockfilename) > portage_util.writemsg("Unlinked lockfile...\n",1) > locking_method(myfd,fcntl.LOCK_UN)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212882
:
145743
| 146366