{"thread":{"id":"21800","subject":"Git open calls fail on NFS-mounted NTFS volume","startedAt":"2009-11-30T23:09:28Z","lastAt":"2009-12-01T00:38:59Z","messageCount":2,"participants":["Kai Lanz","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128815","messageId":"F7CE7D3D-9237-494C-B6C8-6B6D7AB7CE45@stanford.edu","threadId":"21800","inReplyTo":null,"subject":"Git open calls fail on NFS-mounted NTFS volume","fromName":"Kai Lanz","fromEmail":"lanz@stanford.edu","sentAt":"2009-11-30T23:09:28Z","receivedAt":"2009-11-30T23:09:28Z","isPatch":false,"sender":{"key":"lanz@stanford.edu","avatar":null},"body":"\nThere are several places in the code where git calls open() with the  \nflag\nO_EXCL. This causes a problem for us when the current directory is on an\nNFS-mounted NTFS volume shared by an NAS fileserver. The open fails with\n\"EACCES: Permission denied\", even though the user has full read/write\npermissions on the target directory.\n\nI used a tiny C program to confirm that the O_EXCL flag is the culprit;\nremoving that flag from the open() call allows the open to succeed. Of\ncourse, the call also succeeds, with the O_EXCL flag in place, if the\ncurrent directory is on an NFS-mounted UNIX filesystem.\n\nWe're looking into ways to work around this; one way would be to hack  \nthe git\nsource and remove all the O_EXCL flags (are they really needed?), but  \nI'm\nafraid that might break git in horrible ways. Another way might be to  \nmount\nthe NTFS volume via CIFS instead of NFS. But first I wanted to ask if  \nanyone\nhere can offer a solution based on changing our git configuration or  \nour NFS\nmount options or the NTFS volume settings. (At present we have no  \ngitconfig\nfile, so all settings are default).\n\nGit version is 1.6.5.3, running on x86_64 RHEL-4, kernel 2.6.9-89.  \nThe error\nthe user sees is:\n\n > cd /WWW\n > git init\nfatal: cannot copy '/usr/local/share/git-core/templates/info/exclude' to\n'/WWW/.git/info/exclude': Permission denied\n\nUsing strace, we can see the offending call:\n\nopen(\"/WWW/.git/info/exclude\", O_WRONLY|O_CREAT|O_EXCL, 0666) = -1  \nEACCES\n(Permission denied)\n\nWe know the user has permission to create this file because he can cd  \ninto\n/WWW/.git/info and copy exclude there from the templates directory by  \nhand.\n\n-- \nKai Lanz            Stanford University School of Earth Sciences\n"},{"id":"128828","messageId":"7vhbsba5p8.fsf@alter.siamese.dyndns.org","threadId":"21800","inReplyTo":"F7CE7D3D-9237-494C-B6C8-6B6D7AB7CE45@stanford.edu","subject":"Re: Git open calls fail on NFS-mounted NTFS volume","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-01T00:38:59Z","receivedAt":"2009-12-01T00:38:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kai Lanz <lanz@stanford.edu> writes:\n\n> There are several places in the code where git calls open() with the\n> flag\n> O_EXCL. This causes a problem for us when the current directory is on an\n> NFS-mounted NTFS volume shared by an NAS fileserver.\n> ...\n> Git version is 1.6.5.3, running on x86_64 RHEL-4, kernel 2.6.9-89.\n\nI do not use nor have access to RHEL, but does this ring a bell?\n\n    https://bugzilla.redhat.com/show_bug.cgi?id=524520\n"}]}