git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Konrad Bucheli (PSI)" <konrad.bucheli@psi.ch>
Cc: git@vger.kernel.org
Subject: Re: chmod failure on GVFS mounted CIFS share
Date: Fri, 13 Dec 2024 03:41:12 +0000	[thread overview]
Message-ID: <Z1us2FpyObVpJlsM@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <d26f4b93-57a3-4536-8c32-3ed5b3e98a86@psi.ch>

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

On 2024-12-12 at 09:14:50, Konrad Bucheli (PSI) wrote:
> Dear git developers
> 
> Below my bug report:
> 
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> I do a `git init .` on a directory which is CIFS mounted via gio mount
> (FUSE).
> On RHEL8 this needs gvfs-smb and gvfs-fuse installed.
> Mount command: gio mount smb://fs01.psi.ch/my_user_name$

In general, gvfs's FUSE driver isn't a good way to interact with files.
My experience with its SFTP driver is that it has a bunch of weird,
non-Unixy behaviour that's due to limitations in the gio interface.  So
it probably doesn't provide the functionality most Unix programs will
expect from a file system, which will cause you a world of problems down
the line, as you've seen here.

> What did you expect to happen? (Expected behavior)
> 
> It initializes the git repo.
> 
> What happened instead? (Actual behavior)
> 
> $ git init .
> error: chmod on /run/user/44951/gvfs/smb-share:server=fs01.psi.ch,share=my_user_name$/git/foo/.git/config.lock
> failed: Operation not supported
> fatal: could not set 'core.filemode' to 'false'
> $

This is indeed the case, since the chmod on the config file fails.  We
always rewrite the config file as a separate lock file, and then rename
into place.  (This prevents concurrent modification correctly even on
network file systems.)  The user generally wants the permissions to be
preserved, so this is the safe default.

This also happens when using a Linux Git on a WSL Windows mount.

Note that even Windows honours the read-only/read-write difference for
files, so in theory chmod is useful even on CIFS and other Windows file
systems.

If I remember correctly, the consensus last time this came up was that
someone is welcome to add a config option that ignores the chmod
failure, but that in general, we don't want to just silently ignore it.
Unfortunately, nobody has added such a configuration option yet.

I will note that the `mount.cifs(8)` manual page[0] indicates that the
Linux kernel CIFS driver _does_ silently ignore chmod operations when
the server doesn't support them, but it also supports using and storing
Unix permissions if the server does, so that may be a workaround.

[0] https://linux.die.net/man/8/mount.cifs
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2024-12-13  3:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12  9:14 chmod failure on GVFS mounted CIFS share Konrad Bucheli (PSI)
2024-12-13  3:41 ` brian m. carlson [this message]
2024-12-13 10:32   ` Konrad Bucheli (PSI)
2024-12-15 22:30     ` brian m. carlson
2024-12-20 14:42       ` Konrad Bucheli (PSI)
2024-12-20 15:44         ` Junio C Hamano
2024-12-20 15:50           ` Konrad Bucheli (PSI)
2025-01-10 12:05             ` Konrad Bucheli (PSI)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1us2FpyObVpJlsM@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=konrad.bucheli@psi.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).