]> www.infradead.org Git - users/hch/misc.git/commitdiff
cifs: Add comments for DeletePending assignments in open functions
authorPali Rohár <pali@kernel.org>
Sun, 1 Jun 2025 16:01:54 +0000 (18:01 +0200)
committerSteve French <stfrench@microsoft.com>
Fri, 10 Oct 2025 04:01:24 +0000 (23:01 -0500)
On more places is set DeletePending member to 0. Add comments why is 0 the
correct value. Paths in DELETE_PENDING state cannot be opened by new calls.
So if the newly issued open for that path succeed then it means that the
path cannot be in DELETE_PENDING state.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifssmb.c
fs/smb/client/smb2inode.c
fs/smb/client/smb2pdu.c

index d20766f664c49354eea35a015121e06eaeb40c37..2881efcbe09a30ca77d39c84c7b7facaa0ccff02 100644 (file)
@@ -1163,7 +1163,7 @@ OldOpenRetry:
                                cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile));
                        pfile_info->EndOfFile = pfile_info->AllocationSize;
                        pfile_info->NumberOfLinks = cpu_to_le32(1);
-                       pfile_info->DeletePending = 0;
+                       pfile_info->DeletePending = 0; /* successful open = not delete pending */
                }
        }
 
@@ -1288,7 +1288,7 @@ openRetry:
                buf->AllocationSize = rsp->AllocationSize;
                buf->EndOfFile = rsp->EndOfFile;
                buf->NumberOfLinks = cpu_to_le32(1);
-               buf->DeletePending = 0;
+               buf->DeletePending = 0; /* successful open = not delete pending */
        }
 
        cifs_buf_release(req);
index e441fa2e768979feae86b308fbda49f10ca64a97..09e3fc81d7cbc7f807ddb2cf6ba6c8cf615967b4 100644 (file)
@@ -676,7 +676,7 @@ finished:
                idata->fi.EndOfFile = create_rsp->EndofFile;
                if (le32_to_cpu(idata->fi.NumberOfLinks) == 0)
                        idata->fi.NumberOfLinks = cpu_to_le32(1); /* dummy value */
-               idata->fi.DeletePending = 0;
+               idata->fi.DeletePending = 0; /* successful open = not delete pending */
                idata->fi.Directory = !!(le32_to_cpu(create_rsp->FileAttributes) & ATTR_DIRECTORY);
 
                /* smb2_parse_contexts() fills idata->fi.IndexNumber */
index 42e2d4ea344da74be6eceecf154f0b76bc73a469..b0739a2661bf95193f73aa14dfcc78bead113623 100644 (file)
@@ -3277,7 +3277,7 @@ replay_again:
                buf->EndOfFile = rsp->EndofFile;
                buf->Attributes = rsp->FileAttributes;
                buf->NumberOfLinks = cpu_to_le32(1);
-               buf->DeletePending = 0;
+               buf->DeletePending = 0; /* successful open = not delete pending */
        }