[PATCH 12/35] cifs: Fix DELETE comments in cifs_rename_pending_delete()

Pali Rohár posted 35 patches 1 month ago
[PATCH 12/35] cifs: Fix DELETE comments in cifs_rename_pending_delete()
Posted by Pali Rohár 1 month ago
DELETE_ON_CLOSE is a flag which is being set during the opening a file and
DELETE_PENDING flag is being set by SetFileDisposition() on the already
opened file. Those two flags are different and have different meaning.

There in the function cifs_rename_pending_delete() is being set
DELETE_PENDING flag on the already opened file.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/smb/client/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index a37dfd50f33d..88d1d657cfb0 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -1686,7 +1686,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
 
 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
 /*
- * Open the given file (if it isn't already), set the DELETE_ON_CLOSE bit
+ * Open the given file (if it isn't already), set the DELETE_PENDING bit
  * and rename it to a random name that hopefully won't conflict with
  * anything else.
  */
@@ -1805,7 +1805,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
 		goto undo_setattr;
 	}
 
-	/* try to set DELETE_ON_CLOSE */
+	/* try to set DELETE_PENDING */
 	if (!test_bit(CIFS_INO_DELETE_PENDING, &cifsInode->flags)) {
 		rc = CIFSSMBSetFileDisposition(xid, tcon, true, fid.netfid,
 					       current->tgid);
-- 
2.20.1