husy394 / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
Blob Blame History Raw

--- a/fs/cifs/smb2file.c	2019-12-13 16:02:36.554483353 +1100
+++ b/fs/cifs/smb2file.c	2019-12-13 16:04:43.955718087 +1100
@@ -61,6 +61,9 @@
 	oparms->desired_access |= FILE_READ_ATTRIBUTES;
 	smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH;
 
+	if (backup_cred(oparms->cifs_sb))
+		oparms->create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL);
 	if (rc)
 		goto out;
--- a/fs/cifs/smb2inode.c	2019-12-13 16:02:41.945747190 +1100
+++ b/fs/cifs/smb2inode.c	2019-12-13 16:04:48.929961516 +1100
@@ -60,6 +60,9 @@
 	oparms.fid = &fid;
 	oparms.reconnect = false;
 
+	if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
 	if (rc) {
 		kfree(utf16_path);
--- a/fs/cifs/smb2ops.c	2019-12-13 16:02:53.280301878 +1100
+++ b/fs/cifs/smb2ops.c	2019-12-13 16:05:00.987551588 +1100
@@ -385,6 +385,9 @@
 	oparms.fid = &fid;
 	oparms.reconnect = false;
 
+        if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
 	if (rc) {
 		kfree(utf16_path);
@@ -535,6 +538,9 @@
 	oparms.fid = &fid;
 	oparms.reconnect = false;
 
+	if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
 	kfree(utf16_path);
 	if (rc) {
@@ -614,6 +620,9 @@
 	oparms.fid = &fid;
 	oparms.reconnect = false;
 
+	if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
 	kfree(utf16_path);
 	if (rc) {
@@ -1192,6 +1201,9 @@
 	oparms.fid = fid;
 	oparms.reconnect = false;
 
+        if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL);
 	kfree(utf16_path);
 	if (rc) {
@@ -1465,6 +1477,9 @@
 	oparms.fid = &fid;
 	oparms.reconnect = false;
 
+        if (backup_cred(cifs_sb))
+		oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
+
 	rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, &err_buf);
 
 	if (!rc || !err_buf) {