From: <rsbecker@nexbridge.com>
To: "'Jeff King'" <peff@peff.net>, "'Yuri'" <yuri@rawbw.com>
Cc: "'Junio C Hamano'" <gitster@pobox.com>,
"'Git Mailing List'" <git@vger.kernel.org>
Subject: RE: [BUG] "git clean -df ." silently doesn't delete folders with stale .nfs* files
Date: Tue, 11 Jun 2024 09:48:43 -0400 [thread overview]
Message-ID: <102101dabc06$16dfead0$449fc070$@nexbridge.com> (raw)
In-Reply-To: <20240611064847.GC3248245@coredump.intra.peff.net>
On Tuesday, June 11, 2024 2:49 AM, Jeff King wrote:
>On Mon, Jun 10, 2024 at 06:09:52PM -0700, 'Yuri' wrote:
>
>> "touch .nfs12309" isn't enough.
>>
>> Here is a reliable way to reproduce the problem:
>> 1. Have a git repository on an NFS disk.
>> 2. mkdir xx
>> 3. touch xx/x
>> 4. tail -f xx/x &
>> 5. rm xx/x
>> 6. git clean -df .
>>
>> The last operation reproduces the problem. The xx directory and the
>> .nfsNNNN file in it stay without warnings.
>> The .nfsNNNN file is created by the NFS client when the xx/x file is
>> removed.
>
>That is not the behavior I get. I see:
>
> $ git clean -df .
> warning: failed to remove xx/.nfs0000000002c8197f00000002: Device or
>resource busy
>
>Which makes sense, since the kernel fails our unlink() call. Maybe your system
>behaves differently at the syscall level?
>
>This is a pretty standard Debian system with kernel 6.8.12. I set up the NFS mount
>with:
>
> mkdir /mnt/{server,client}
> exportfs -o rw,sync 127.0.0.1:/mnt/server
> mount -t nfs 127.0.0.1:/mnt/server /mnt/client
>
>and then made the repository in /mnt/client. "mount" tells me it's using nfs4.
>
>Running "git clean" on the server side does remove the files (no warning, but the
>directories are actually removed).
It has been a while since I did a self-mount in NFS, but I do not think that will reproduce the issue. The mounts have to be on different servers from the client to experience this silly rename situation. On self-mount, IIRC, the client is aware that it is on its own machine and will not try to detect the situation.
next prev parent reply other threads:[~2024-06-11 13:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 18:36 [BUG] "git clean -df ." silently doesn't delete folders with stale .nfs* files Yuri
2024-06-10 19:58 ` Junio C Hamano
2024-06-10 20:08 ` Yuri
2024-06-10 21:37 ` Junio C Hamano
2024-06-10 23:27 ` Yuri
2024-06-10 23:55 ` rsbecker
2024-06-11 0:29 ` Junio C Hamano
2024-06-11 1:09 ` 'Yuri'
2024-06-11 1:19 ` rsbecker
2024-06-11 1:22 ` 'Yuri'
2024-06-11 1:46 ` Chris Torek
2024-06-11 6:48 ` Jeff King
2024-06-11 7:43 ` 'Yuri'
2024-06-13 8:09 ` Gabor Gombas
2024-06-13 9:21 ` 'Yuri'
2024-06-11 13:48 ` rsbecker [this message]
2024-06-11 17:46 ` 'Yuri'
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='102101dabc06$16dfead0$449fc070$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=yuri@rawbw.com \
/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