Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Steve French <smfrench@gmail.com>
Cc: Ralph Boehme <slow@samba.org>, Steve French <sfrench@samba.org>,
	Paulo Alcantara <pc@manguebit.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	linux-cifs@vger.kernel.org
Subject: Re: SMB2 DELETE vs UNLINK
Date: Mon, 14 Oct 2024 11:49:13 +0200	[thread overview]
Message-ID: <20241014094913.nyaltrl2t7vjhcuw@pali> (raw)
In-Reply-To: <CAH2r5mvUjZdDo2gEZ-PSrP5cYT7q25yT7-J1RcaaLxGh-h7Eaw@mail.gmail.com>

I checked it and seems that both Windows SMB client and Windows SMB
server on Windows Server 2022 filter out this class 64.

Windows SMB client does not send request to server at all and
immediately return error to application which tried to use class 64. And
Windows SMB server returns STATUS_NOT_IMPLEMENTED, which indicates that
server recognized it, but filtered it. Older Windows servers returns
STATUS_INVALID_INFO_CLASS which indicates that they did not understand
class 64 at all.

So seems that against Windows SMB implementation, this class 64 is
unusable for now.


Anyway, can somebody ask in Microsoft if they can allow to use
class 64 (FileDispositionInformationEx) and class 65
(FileRenameInformationEx) in their SMB client and server?
This would really help with Linux/POSIX interop, which Windows already
provided for local filesystems.

Steve, are you able to ask somebody in Microsoft for this?

On Wednesday 09 October 2024 00:03:03 Steve French wrote:
> FILE_DISPOSITION_DO_NOT_DELETE  0x00000000 Specifies the system should
> not delete a file.
> FILE_DISPOSITION_DELETE  0x00000001 Specifies the system should delete a file.
> FILE_DISPOSITION_POSIX_SEMANTICS  0x00000002 Specifies the system
> should perform a POSIX-style delete.
> FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK  0x00000004 Specifies the
> system should force an image section check.
> FILE_DISPOSITION_ON_CLOSE  0x00000008Specifies if the system sets or
> clears the on-close state.
> FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE  0x00000010 Allows
> read-only files to be deleted.
> 
> These are interesting flags, but are we certain they are passed
> through over SMB3.1.1 by current Windows?  It is possible that they
> are filtered and thus local only
> 
> Have you tried setting them remotely over an SMB3.1.1 mount to Windows server?
> 
> On Tue, Oct 8, 2024 at 1:18 PM Pali Rohár <pali@kernel.org> wrote:
> >
> > On Tuesday 08 October 2024 11:40:06 Ralph Boehme wrote:
> > > On 10/6/24 12:31 PM, Pali Rohár wrote:
> > > > But starting with Windows 10, version 1709, there is support also
> > > > for UNLINK operation, via class 64 (FileDispositionInformationEx)
> > > > [1] where is FILE_DISPOSITION_POSIX_SEMANTICS flag [2] which does
> > > > UNLINK after CLOSE and let file content usable for all other
> > > > processes. Internally Windows NT kernel moves this file on NTFS from
> > > > its directory into some hidden are. Which is de-facto same as what
> > > > is POSIX unlink. There is also class 65 (FileRenameInformationEx)
> > > > which is allows to issue POSIX rename (unlink the target if it
> > > > exists).
> > >
> > > interesting. Thanks for pointing these out!
> > >
> > > > What do you think about using & implementing this functionality for
> > > > the Linux unlink operation? As the class numbers are already
> > > > reserved and documented, I think that it could make sense to use
> > > > them also over SMB on POSIX systems.
> > >
> > > for SMB3 POSIX this will be the behaviour on POSIX handles so we don't
> > > need an on the wire change. This is part of what will become POSIX-FSA.
> > >
> > > > Also there is another flag
> > > > FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE which can be useful for
> > > > unlink. It allows to unlink also file which has read-only attribute
> > > > set. So no need to do that racy (unset-readonly, set-delete-pending,
> > > > set-read-only) compound on files with more file hardlinks.
> > > >
> > > > I think that this is something which SMB3 POSIX extensions can use
> > > > and do not have to invent new extensions for the same functionality.
> > >
> > > same here (taking note to remember to add this to the POSIX-FSA and
> > > check Samba behaviour).
> > >
> > > -slow
> >
> > So the behavior when the POSIX extension is active would be same as if
> > every DELETE_ON_CLOSE and every DELETE_PENDING=true requests would set
> > those new NT flags FILE_DISPOSITION_POSIX_SEMANTICS and
> > FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE?
> >
> 
> 
> -- 
> Thanks,
> 
> Steve

  reply	other threads:[~2024-10-14  9:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 10:31 SMB2 DELETE vs UNLINK Pali Rohár
2024-10-07  4:18 ` Steve French
2024-10-07 18:48   ` Pali Rohár
2024-10-08  0:07     ` Steve French
2024-10-08  9:40 ` Ralph Boehme
2024-10-08 18:18   ` Pali Rohár
2024-10-08 20:16     ` Ralph Boehme
2024-10-09  5:03     ` Steve French
2024-10-14  9:49       ` Pali Rohár [this message]
2024-12-27 15:58         ` Pali Rohár
2024-12-27 16:30           ` Tom Talpey
2024-12-25 14:47 ` Pali Rohár
2024-12-27 16:21   ` Tom Talpey
2024-12-27 16:32     ` Pali Rohár
2024-12-27 16:43       ` Tom Talpey
2024-12-27 18:51         ` Pali Rohár
2025-04-08 22:43           ` Pali Rohár
2025-04-09  6:50             ` Fwd: " Ralph Boehme
2025-04-09 15:57               ` [EXTERNAL] Fwd: SMB2 DELETE vs UNLINK - TrackingID#2504090040009564 Michael Bowen
2025-04-10  5:57                 ` Tom Talpey
2025-04-10 11:07                 ` Obaid Farooqi
2025-05-06 19:00                   ` Obaid Farooqi
2025-08-31 12:55                     ` Pali Rohár

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=20241014094913.nyaltrl2t7vjhcuw@pali \
    --to=pali@kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pc@manguebit.com \
    --cc=sfrench@samba.org \
    --cc=slow@samba.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