@@ -223,14 +223,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
223
223
SMB2_O_INFO_FILE , 0 ,
224
224
sizeof (struct smb2_file_all_info ) +
225
225
PATH_MAX * 2 , 0 , NULL );
226
- if (!rc ) {
227
- smb2_set_next_command (tcon , & rqst [num_rqst ]);
228
- smb2_set_related (& rqst [num_rqst ]);
229
- }
230
226
}
231
-
232
- if (rc )
227
+ if (!rc && (!cfile || num_rqst > 1 )) {
228
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
229
+ smb2_set_related (& rqst [num_rqst ]);
230
+ } else if (rc ) {
233
231
goto finished ;
232
+ }
234
233
num_rqst ++ ;
235
234
trace_smb3_query_info_compound_enter (xid , ses -> Suid ,
236
235
tcon -> tid , full_path );
@@ -260,14 +259,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
260
259
sizeof (struct smb311_posix_qinfo * ) +
261
260
(PATH_MAX * 2 ) +
262
261
(sizeof (struct cifs_sid ) * 2 ), 0 , NULL );
263
- if (!rc ) {
264
- smb2_set_next_command (tcon , & rqst [num_rqst ]);
265
- smb2_set_related (& rqst [num_rqst ]);
266
- }
267
262
}
268
-
269
- if (rc )
263
+ if (!rc && (!cfile || num_rqst > 1 )) {
264
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
265
+ smb2_set_related (& rqst [num_rqst ]);
266
+ } else if (rc ) {
270
267
goto finished ;
268
+ }
271
269
num_rqst ++ ;
272
270
trace_smb3_posix_query_info_compound_enter (xid , ses -> Suid ,
273
271
tcon -> tid , full_path );
@@ -325,13 +323,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
325
323
FILE_END_OF_FILE_INFORMATION ,
326
324
SMB2_O_INFO_FILE , 0 ,
327
325
data , size );
328
- if (!rc ) {
329
- smb2_set_next_command (tcon , & rqst [num_rqst ]);
330
- smb2_set_related (& rqst [num_rqst ]);
331
- }
332
326
}
333
- if (rc )
327
+ if (!rc && (!cfile || num_rqst > 1 )) {
328
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
329
+ smb2_set_related (& rqst [num_rqst ]);
330
+ } else if (rc ) {
334
331
goto finished ;
332
+ }
335
333
num_rqst ++ ;
336
334
trace_smb3_set_eof_enter (xid , ses -> Suid , tcon -> tid , full_path );
337
335
break ;
@@ -356,14 +354,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
356
354
COMPOUND_FID , current -> tgid ,
357
355
FILE_BASIC_INFORMATION ,
358
356
SMB2_O_INFO_FILE , 0 , data , size );
359
- if (!rc ) {
360
- smb2_set_next_command (tcon , & rqst [num_rqst ]);
361
- smb2_set_related (& rqst [num_rqst ]);
362
- }
363
357
}
364
-
365
- if (rc )
358
+ if (!rc && (!cfile || num_rqst > 1 )) {
359
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
360
+ smb2_set_related (& rqst [num_rqst ]);
361
+ } else if (rc ) {
366
362
goto finished ;
363
+ }
367
364
num_rqst ++ ;
368
365
trace_smb3_set_info_compound_enter (xid , ses -> Suid ,
369
366
tcon -> tid , full_path );
@@ -397,13 +394,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
397
394
COMPOUND_FID , COMPOUND_FID ,
398
395
current -> tgid , FILE_RENAME_INFORMATION ,
399
396
SMB2_O_INFO_FILE , 0 , data , size );
400
- if (!rc ) {
401
- smb2_set_next_command (tcon , & rqst [num_rqst ]);
402
- smb2_set_related (& rqst [num_rqst ]);
403
- }
404
397
}
405
- if (rc )
398
+ if (!rc && (!cfile || num_rqst > 1 )) {
399
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
400
+ smb2_set_related (& rqst [num_rqst ]);
401
+ } else if (rc ) {
406
402
goto finished ;
403
+ }
407
404
num_rqst ++ ;
408
405
trace_smb3_rename_enter (xid , ses -> Suid , tcon -> tid , full_path );
409
406
break ;
@@ -438,30 +435,53 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
438
435
rqst [num_rqst ].rq_iov = vars -> io_iov ;
439
436
rqst [num_rqst ].rq_nvec = ARRAY_SIZE (vars -> io_iov );
440
437
441
- rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
442
- COMPOUND_FID , COMPOUND_FID ,
443
- FSCTL_SET_REPARSE_POINT ,
444
- in_iov [i ].iov_base ,
445
- in_iov [i ].iov_len , 0 );
446
- if (rc )
438
+ if (cfile ) {
439
+ rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
440
+ cfile -> fid .persistent_fid ,
441
+ cfile -> fid .volatile_fid ,
442
+ FSCTL_SET_REPARSE_POINT ,
443
+ in_iov [i ].iov_base ,
444
+ in_iov [i ].iov_len , 0 );
445
+ } else {
446
+ rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
447
+ COMPOUND_FID , COMPOUND_FID ,
448
+ FSCTL_SET_REPARSE_POINT ,
449
+ in_iov [i ].iov_base ,
450
+ in_iov [i ].iov_len , 0 );
451
+ }
452
+ if (!rc && (!cfile || num_rqst > 1 )) {
453
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
454
+ smb2_set_related (& rqst [num_rqst ]);
455
+ } else if (rc ) {
447
456
goto finished ;
448
- smb2_set_next_command ( tcon , & rqst [ num_rqst ]);
449
- smb2_set_related ( & rqst [ num_rqst ++ ]) ;
457
+ }
458
+ num_rqst ++ ;
450
459
trace_smb3_set_reparse_compound_enter (xid , ses -> Suid ,
451
460
tcon -> tid , full_path );
452
461
break ;
453
462
case SMB2_OP_GET_REPARSE :
454
463
rqst [num_rqst ].rq_iov = vars -> io_iov ;
455
464
rqst [num_rqst ].rq_nvec = ARRAY_SIZE (vars -> io_iov );
456
465
457
- rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
458
- COMPOUND_FID , COMPOUND_FID ,
459
- FSCTL_GET_REPARSE_POINT ,
460
- NULL , 0 , CIFSMaxBufSize );
461
- if (rc )
466
+ if (cfile ) {
467
+ rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
468
+ cfile -> fid .persistent_fid ,
469
+ cfile -> fid .volatile_fid ,
470
+ FSCTL_GET_REPARSE_POINT ,
471
+ NULL , 0 , CIFSMaxBufSize );
472
+ } else {
473
+ rc = SMB2_ioctl_init (tcon , server , & rqst [num_rqst ],
474
+ COMPOUND_FID , COMPOUND_FID ,
475
+ FSCTL_GET_REPARSE_POINT ,
476
+ NULL , 0 , CIFSMaxBufSize );
477
+ }
478
+ if (!rc && (!cfile || num_rqst > 1 )) {
479
+ smb2_set_next_command (tcon , & rqst [num_rqst ]);
480
+ smb2_set_related (& rqst [num_rqst ]);
481
+ } else if (rc ) {
462
482
goto finished ;
463
- smb2_set_next_command ( tcon , & rqst [ num_rqst ]);
464
- smb2_set_related ( & rqst [ num_rqst ++ ]) ;
483
+ }
484
+ num_rqst ++ ;
465
485
trace_smb3_get_reparse_compound_enter (xid , ses -> Suid ,
466
486
tcon -> tid , full_path );
467
487
break ;
0 commit comments