Skip to content

Commit d43df69

Browse files
committed
Merge tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: "Three smb3 client fixes, all also for stable: - two small locking fixes spotted by Coverity - FILE_ALL_INFO and network_open_info packing fix" * tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: smb3: fix lock ordering potential deadlock in cifs_sync_mid_result smb3: missing lock when picking channel smb: client: Fix struct_group() usage in __packed structs
2 parents 5d12ed4 + 8861fd5 commit d43df69

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

fs/smb/client/cifspdu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ typedef struct smb_com_open_rsp {
882882
__u8 OplockLevel;
883883
__u16 Fid;
884884
__le32 CreateAction;
885-
struct_group(common_attributes,
885+
struct_group_attr(common_attributes, __packed,
886886
__le64 CreationTime;
887887
__le64 LastAccessTime;
888888
__le64 LastWriteTime;
@@ -2266,7 +2266,7 @@ typedef struct {
22662266
/* QueryFileInfo/QueryPathinfo (also for SetPath/SetFile) data buffer formats */
22672267
/******************************************************************************/
22682268
typedef struct { /* data block encoding of response to level 263 QPathInfo */
2269-
struct_group(common_attributes,
2269+
struct_group_attr(common_attributes, __packed,
22702270
__le64 CreationTime;
22712271
__le64 LastAccessTime;
22722272
__le64 LastWriteTime;

fs/smb/client/smb2pdu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ struct smb2_file_reparse_point_info {
320320
} __packed;
321321

322322
struct smb2_file_network_open_info {
323-
struct_group(network_open_info,
323+
struct_group_attr(network_open_info, __packed,
324324
__le64 CreationTime;
325325
__le64 LastAccessTime;
326326
__le64 LastWriteTime;

fs/smb/client/transport.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,12 +909,15 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
909909
list_del_init(&mid->qhead);
910910
mid->mid_flags |= MID_DELETED;
911911
}
912+
spin_unlock(&server->mid_lock);
912913
cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n",
913914
__func__, mid->mid, mid->mid_state);
914915
rc = -EIO;
916+
goto sync_mid_done;
915917
}
916918
spin_unlock(&server->mid_lock);
917919

920+
sync_mid_done:
918921
release_mid(mid);
919922
return rc;
920923
}
@@ -1057,9 +1060,11 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
10571060
index = (uint)atomic_inc_return(&ses->chan_seq);
10581061
index %= ses->chan_count;
10591062
}
1063+
1064+
server = ses->chans[index].server;
10601065
spin_unlock(&ses->chan_lock);
10611066

1062-
return ses->chans[index].server;
1067+
return server;
10631068
}
10641069

10651070
int

0 commit comments

Comments
 (0)