Skip to content

Commit e51da4a

Browse files
committed
Merge tag '6.13-rc4-SMB3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - fix caching of files that will be reused for write - minor cleanup * tag '6.13-rc4-SMB3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: Remove unused is_server_using_iface() smb: enable reuse of deferred file handles for write operations
2 parents fd0584d + f17224c commit e51da4a

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed

fs/smb/client/cifsproto.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,6 @@ int cifs_alloc_hash(const char *name, struct shash_desc **sdesc);
614614
void cifs_free_hash(struct shash_desc **sdesc);
615615

616616
int cifs_try_adding_channels(struct cifs_ses *ses);
617-
bool is_server_using_iface(struct TCP_Server_Info *server,
618-
struct cifs_server_iface *iface);
619617
bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface);
620618
void cifs_ses_mark_for_reconnect(struct cifs_ses *ses);
621619

fs/smb/client/file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,11 @@ int cifs_open(struct inode *inode, struct file *file)
990990
}
991991

992992
/* Get the cached handle as SMB2 close is deferred */
993-
rc = cifs_get_readable_path(tcon, full_path, &cfile);
993+
if (OPEN_FMODE(file->f_flags) & FMODE_WRITE) {
994+
rc = cifs_get_writable_path(tcon, full_path, FIND_WR_FSUID_ONLY, &cfile);
995+
} else {
996+
rc = cifs_get_readable_path(tcon, full_path, &cfile);
997+
}
994998
if (rc == 0) {
995999
if (file->f_flags == cfile->f_flags) {
9961000
file->private_data = cfile;

fs/smb/client/sess.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,6 @@ static int
2727
cifs_ses_add_channel(struct cifs_ses *ses,
2828
struct cifs_server_iface *iface);
2929

30-
bool
31-
is_server_using_iface(struct TCP_Server_Info *server,
32-
struct cifs_server_iface *iface)
33-
{
34-
struct sockaddr_in *i4 = (struct sockaddr_in *)&iface->sockaddr;
35-
struct sockaddr_in6 *i6 = (struct sockaddr_in6 *)&iface->sockaddr;
36-
struct sockaddr_in *s4 = (struct sockaddr_in *)&server->dstaddr;
37-
struct sockaddr_in6 *s6 = (struct sockaddr_in6 *)&server->dstaddr;
38-
39-
if (server->dstaddr.ss_family != iface->sockaddr.ss_family)
40-
return false;
41-
if (server->dstaddr.ss_family == AF_INET) {
42-
if (s4->sin_addr.s_addr != i4->sin_addr.s_addr)
43-
return false;
44-
} else if (server->dstaddr.ss_family == AF_INET6) {
45-
if (memcmp(&s6->sin6_addr, &i6->sin6_addr,
46-
sizeof(i6->sin6_addr)) != 0)
47-
return false;
48-
} else {
49-
/* unknown family.. */
50-
return false;
51-
}
52-
return true;
53-
}
54-
5530
bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface)
5631
{
5732
int i;

0 commit comments

Comments
 (0)