husy394 / rpms / kernel

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