@@ -52,7 +52,6 @@ static struct oplock_info *alloc_opinfo(struct ksmbd_work *work,
52
52
opinfo -> is_smb2 = IS_SMB2 (conn );
53
53
#endif
54
54
INIT_LIST_HEAD (& opinfo -> op_entry );
55
- INIT_LIST_HEAD (& opinfo -> interim_list );
56
55
init_waitqueue_head (& opinfo -> oplock_q );
57
56
init_waitqueue_head (& opinfo -> oplock_brk );
58
57
atomic_set (& opinfo -> refcount , 1 );
@@ -1005,7 +1004,6 @@ static void __smb2_lease_break_noti(struct work_struct *wk)
1005
1004
static int smb2_lease_break_noti (struct oplock_info * opinfo )
1006
1005
{
1007
1006
struct ksmbd_conn * conn = opinfo -> conn ;
1008
- struct list_head * tmp , * t ;
1009
1007
struct ksmbd_work * work ;
1010
1008
struct lease_break_info * br_info ;
1011
1009
struct lease * lease = opinfo -> o_lease ;
@@ -1033,16 +1031,6 @@ static int smb2_lease_break_noti(struct oplock_info *opinfo)
1033
1031
work -> sess = opinfo -> sess ;
1034
1032
1035
1033
if (opinfo -> op_state == OPLOCK_ACK_WAIT ) {
1036
- list_for_each_safe (tmp , t , & opinfo -> interim_list ) {
1037
- struct ksmbd_work * in_work ;
1038
-
1039
- in_work = list_entry (tmp , struct ksmbd_work ,
1040
- interim_entry );
1041
- setup_async_work (in_work , NULL , NULL );
1042
- smb2_send_interim_resp (in_work , STATUS_PENDING );
1043
- list_del_init (& in_work -> interim_entry );
1044
- release_async_work (in_work );
1045
- }
1046
1034
INIT_WORK (& work -> work , __smb2_lease_break_noti );
1047
1035
ksmbd_queue_work (work );
1048
1036
wait_for_break_ack (opinfo );
@@ -1073,7 +1061,8 @@ static void wait_lease_breaking(struct oplock_info *opinfo)
1073
1061
}
1074
1062
}
1075
1063
1076
- static int oplock_break (struct oplock_info * brk_opinfo , int req_op_level )
1064
+ static int oplock_break (struct oplock_info * brk_opinfo , int req_op_level ,
1065
+ struct ksmbd_work * in_work )
1077
1066
{
1078
1067
int err = 0 ;
1079
1068
@@ -1116,9 +1105,15 @@ static int oplock_break(struct oplock_info *brk_opinfo, int req_op_level)
1116
1105
}
1117
1106
1118
1107
if (lease -> state & (SMB2_LEASE_WRITE_CACHING_LE |
1119
- SMB2_LEASE_HANDLE_CACHING_LE ))
1108
+ SMB2_LEASE_HANDLE_CACHING_LE )) {
1109
+ if (in_work ) {
1110
+ setup_async_work (in_work , NULL , NULL );
1111
+ smb2_send_interim_resp (in_work , STATUS_PENDING );
1112
+ release_async_work (in_work );
1113
+ }
1114
+
1120
1115
brk_opinfo -> op_state = OPLOCK_ACK_WAIT ;
1121
- else
1116
+ } else
1122
1117
atomic_dec (& brk_opinfo -> breaking_cnt );
1123
1118
} else {
1124
1119
err = oplock_break_pending (brk_opinfo , req_op_level );
@@ -1332,7 +1327,7 @@ void smb_send_parent_lease_break_noti(struct ksmbd_file *fp,
1332
1327
if (ksmbd_conn_releasing (opinfo -> conn ))
1333
1328
continue ;
1334
1329
1335
- oplock_break (opinfo , SMB2_OPLOCK_LEVEL_NONE );
1330
+ oplock_break (opinfo , SMB2_OPLOCK_LEVEL_NONE , NULL );
1336
1331
opinfo_put (opinfo );
1337
1332
}
1338
1333
}
@@ -1368,7 +1363,7 @@ void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp)
1368
1363
1369
1364
if (ksmbd_conn_releasing (opinfo -> conn ))
1370
1365
continue ;
1371
- oplock_break (opinfo , SMB2_OPLOCK_LEVEL_NONE );
1366
+ oplock_break (opinfo , SMB2_OPLOCK_LEVEL_NONE , NULL );
1372
1367
opinfo_put (opinfo );
1373
1368
}
1374
1369
}
@@ -1468,8 +1463,7 @@ int smb_grant_oplock(struct ksmbd_work *work, int req_op_level, u64 pid,
1468
1463
goto op_break_not_needed ;
1469
1464
}
1470
1465
1471
- list_add (& work -> interim_entry , & prev_opinfo -> interim_list );
1472
- err = oplock_break (prev_opinfo , SMB2_OPLOCK_LEVEL_II );
1466
+ err = oplock_break (prev_opinfo , SMB2_OPLOCK_LEVEL_II , work );
1473
1467
opinfo_put (prev_opinfo );
1474
1468
if (err == - ENOENT )
1475
1469
goto set_lev ;
@@ -1538,8 +1532,7 @@ static void smb_break_all_write_oplock(struct ksmbd_work *work,
1538
1532
}
1539
1533
1540
1534
brk_opinfo -> open_trunc = is_trunc ;
1541
- list_add (& work -> interim_entry , & brk_opinfo -> interim_list );
1542
- oplock_break (brk_opinfo , SMB2_OPLOCK_LEVEL_II );
1535
+ oplock_break (brk_opinfo , SMB2_OPLOCK_LEVEL_II , work );
1543
1536
opinfo_put (brk_opinfo );
1544
1537
}
1545
1538
@@ -1633,7 +1626,7 @@ void smb_break_all_levII_oplock(struct ksmbd_work *work, struct ksmbd_file *fp,
1633
1626
SMB2_LEASE_KEY_SIZE ))
1634
1627
goto next ;
1635
1628
brk_op -> open_trunc = is_trunc ;
1636
- oplock_break (brk_op , SMB2_OPLOCK_LEVEL_NONE );
1629
+ oplock_break (brk_op , SMB2_OPLOCK_LEVEL_NONE , NULL );
1637
1630
next :
1638
1631
opinfo_put (brk_op );
1639
1632
rcu_read_lock ();
0 commit comments