Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Steve French <smfrench@gmail.com>
Cc: CIFS <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: Improve SMB2+ stat() to work also for paths in DELETE_PENDING state
Date: Tue, 25 Mar 2025 09:42:24 +0100	[thread overview]
Message-ID: <20250325084224.fc7yoo4zsupojkco@pali> (raw)
In-Reply-To: <CAH2r5msmKZA9-dX4G_uXujMuNLHxWUz1yprWRSabu-Bcdp7EOQ@mail.gmail.com>

Hello, this change is not reverse of what POSIX requires.

Delete pending state is special thing in Windows and is just a temporary
state, which may be reverted.

In POSIX, the real unlink is the final state and once unlink finish, the
directory entry is not in the parent directory anymore, and such
directory can be removed.

But on the other hand, if the file in the directory is in delete pending
state, then the directory cannot be removed. Directory can be removed
once all files are not in delete pending state anymore and are really
removed.

Any file in delete pending state is visible over SMB protocol to any
application, not just to application which opened it.

Silly rename is not an option here, because file can be put into delete
pending state by windows server itself -- which does not do any silly
rename strategy.

And for example msvcrt.dll stat() function on Windows is doing same
thing. Stat is querying also files in delete pending state.

On Monday 24 March 2025 22:53:35 Steve French wrote:
> In thinking about this patch, isn't it doing the reverse of what POSIX requires?
> 
> When querying a file in delete pending state, shouldn't be invisible
> in the namespace on the client.  Wouldn't your patch do the opposite?
> ie Doesn't it allow stat to return information about a file which
> should be invisible to everyone except the app who has it open (and if
> possible we could make this easier via a "silly rename" strategy as
> some other protocols do)?
> 
> Thoughts?
> 
> 
> 
> -- 
> Thanks,
> 
> Steve

      reply	other threads:[~2025-03-25  8:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25  3:53 [PATCH] cifs: Improve SMB2+ stat() to work also for paths in DELETE_PENDING state Steve French
2025-03-25  8:42 ` Pali Rohár [this message]

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=20250325084224.fc7yoo4zsupojkco@pali \
    --to=pali@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.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