Skip to content

Commit fa9fe87

Browse files
palismfrench
authored andcommitted
cifs: Add comments for DeletePending assignments in open functions
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 <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 92210cc commit fa9fe87

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fs/smb/client/cifssmb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
11631163
cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile));
11641164
pfile_info->EndOfFile = pfile_info->AllocationSize;
11651165
pfile_info->NumberOfLinks = cpu_to_le32(1);
1166-
pfile_info->DeletePending = 0;
1166+
pfile_info->DeletePending = 0; /* successful open = not delete pending */
11671167
}
11681168
}
11691169

@@ -1288,7 +1288,7 @@ CIFS_open(const unsigned int xid, struct cifs_open_parms *oparms, int *oplock,
12881288
buf->AllocationSize = rsp->AllocationSize;
12891289
buf->EndOfFile = rsp->EndOfFile;
12901290
buf->NumberOfLinks = cpu_to_le32(1);
1291-
buf->DeletePending = 0;
1291+
buf->DeletePending = 0; /* successful open = not delete pending */
12921292
}
12931293

12941294
cifs_buf_release(req);

fs/smb/client/smb2inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
676676
idata->fi.EndOfFile = create_rsp->EndofFile;
677677
if (le32_to_cpu(idata->fi.NumberOfLinks) == 0)
678678
idata->fi.NumberOfLinks = cpu_to_le32(1); /* dummy value */
679-
idata->fi.DeletePending = 0;
679+
idata->fi.DeletePending = 0; /* successful open = not delete pending */
680680
idata->fi.Directory = !!(le32_to_cpu(create_rsp->FileAttributes) & ATTR_DIRECTORY);
681681

682682
/* smb2_parse_contexts() fills idata->fi.IndexNumber */

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3277,7 +3277,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
32773277
buf->EndOfFile = rsp->EndofFile;
32783278
buf->Attributes = rsp->FileAttributes;
32793279
buf->NumberOfLinks = cpu_to_le32(1);
3280-
buf->DeletePending = 0;
3280+
buf->DeletePending = 0; /* successful open = not delete pending */
32813281
}
32823282

32833283

0 commit comments

Comments
 (0)