this is attempt to install prefix portage on cluster with $HOME on lustre2.0 emergelog(): [Errno 38] Function not implemented emergelog(): [Errno 38] Function not implemented These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] sys-apps/sed-4.2.1-r1 USE="-acl -nls (-selinux) -static" 879 kB Total: 1 package (1 new), Size of downloads: 879 kB Would you like to merge these packages? [Yes/No] >>> Verifying ebuild manifests >>> Emerging (1 of 1) sys-apps/sed-4.2.1-r1 emergelog(): [Errno 38] Function not implemented Traceback (most recent call last): File "/s/ls2/home/users/alexxy/prefix/usr/bin/emerge", line 44, in <module> retval = emerge_main() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/main.py", line 2003, in emerge_main myopts, myaction, myfiles, spinner) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/actions.py", line 438, in action_build retval = mergetask.merge() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/Scheduler.py", line 1079, in merge rval = self._merge() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/Scheduler.py", line 1433, in _merge self._main_loop() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/Scheduler.py", line 1576, in _main_loop while self._schedule(): File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/PollScheduler.py", line 104, in _schedule return self._schedule_tasks() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/Scheduler.py", line 1615, in _schedule_tasks if q.schedule(): File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/SequentialTaskQueue.py", line 55, in schedule task.start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 24, in start self._start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/MergeListItem.py", line 91, in _start self._start_task(build, self._default_final_exit) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/CompositeTask.py", line 146, in _start_task task.start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 24, in start self._start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 89, in _start self._prefetch_exit(prefetcher) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 140, in _prefetch_exit self._build_dir.lock() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/EbuildBuildDir.py", line 45, in lock catdir_lock.start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 24, in start self._start() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/_emerge/AsynchronousLock.py", line 47, in _start wantnewlockfile=True, flags=os.O_NONBLOCK) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/locks.py", line 115, in lockfile locking_method(myfd, fcntl.LOCK_EX|fcntl.LOCK_NB) IOError: [Errno 38] Function not implemented emergelog(): [Errno 38] Function not implemented
(In reply to comment #0) > line 47, in _start > wantnewlockfile=True, flags=os.O_NONBLOCK) > File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/locks.py", > line 115, in lockfile > locking_method(myfd, fcntl.LOCK_EX|fcntl.LOCK_NB) > IOError: [Errno 38] Function not implemented If then happens after applying this patch: --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -148,7 +148,7 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0, raise if out is not None: out.eend(os.EX_OK) - elif e.errno == errno.ENOLCK: + elif e.errno in (errno.ENOLCK, errno.ENOSYS): # We're not allowed to lock on this FS. os.close(myfd) link_success = False Then it means that hardlink_lockfile() is failing. That function doesn't get much testing, since most filesystems support real locking. I plan to make some tests for the hardlink_lockfile() case and see if I can make it work better.
With this patch it failed on install phase >>> Installing (1 of 1) sys-apps/sed-4.2.1-r1 emergelog(): [Errno 9] Bad file descriptor * checking 13 files for package collisions >>> Merging sys-apps/sed-4.2.1-r1 to / Traceback (most recent call last): File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn prev_mtimes=self.prev_mtimes, counter=counter) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4305, in merge counter=counter) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3600, in treewalk self.vartree.dbapi._fs_lock() File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/dbapi/vartree.py", line 243, in _fs_lock self._fs_lock_obj = lockfile(self._conf_mem_file) File "/s/ls2/home/users/alexxy/prefix/usr/lib/portage/pym/portage/locks.py", line 115, in lockfile locking_method(myfd, fcntl.LOCK_EX|fcntl.LOCK_NB) IOError: [Errno 38] Function not implemented >>> Failed to install sys-apps/sed-4.2.1-r1, Log file:
Looking at the hardlink_lockfile() code, it's obvious that it's broken for at least the following reasons: 1) It lacks support for non-blocking locks 2) It doesn't support the lockfile(wantnewlockfile=False) behavior I'll go ahead and implement support for these, along with test cases.
It should be fixed should fixed with these commits: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c11b7c487c518f9a2aceaddbe119a70877053cf5 http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89bcc67e2930a841e1120492634ebc20530bc1d7
Here's a nice optimization: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3bcbe6b069687855fa3cc8f0e39be6c240ee3e3e
Seems your patches works for me =) lustre still mounted without flock.
This is fixed in 2.1.10.41 and 2.2.0_alpha81.