Skip to content

Commit 091619b

Browse files
committed
Merge tag '6.9-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - Add missing trace point (noticed when debugging the recent mknod LSM regression) - fscache fix * tag '6.9-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: Fix duplicate fscache cookie warnings smb3: add trace event for mknod
2 parents 3a3c0de + 8876a37 commit 091619b

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

fs/smb/client/dir.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,18 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode,
612612
goto mknod_out;
613613
}
614614

615+
trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, full_path);
616+
615617
rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon,
616618
full_path, mode,
617619
device_number);
618620

619621
mknod_out:
622+
if (rc)
623+
trace_smb3_mknod_err(xid, tcon->ses->Suid, tcon->tid, rc);
624+
else
625+
trace_smb3_mknod_done(xid, tcon->ses->Suid, tcon->tid);
626+
620627
free_dentry_path(page);
621628
free_xid(xid);
622629
cifs_put_tlink(tlink);

fs/smb/client/fscache.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
#include "cifs_fs_sb.h"
1313
#include "cifsproto.h"
1414

15+
/*
16+
* Key for fscache inode. [!] Contents must match comparisons in cifs_find_inode().
17+
*/
18+
struct cifs_fscache_inode_key {
19+
20+
__le64 uniqueid; /* server inode number */
21+
__le64 createtime; /* creation time on server */
22+
u8 type; /* S_IFMT file type */
23+
} __packed;
24+
1525
static void cifs_fscache_fill_volume_coherency(
1626
struct cifs_tcon *tcon,
1727
struct cifs_fscache_volume_coherency_data *cd)
@@ -97,15 +107,19 @@ void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
97107
void cifs_fscache_get_inode_cookie(struct inode *inode)
98108
{
99109
struct cifs_fscache_inode_coherency_data cd;
110+
struct cifs_fscache_inode_key key;
100111
struct cifsInodeInfo *cifsi = CIFS_I(inode);
101112
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
102113
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
103114

115+
key.uniqueid = cpu_to_le64(cifsi->uniqueid);
116+
key.createtime = cpu_to_le64(cifsi->createtime);
117+
key.type = (inode->i_mode & S_IFMT) >> 12;
104118
cifs_fscache_fill_coherency(&cifsi->netfs.inode, &cd);
105119

106120
cifsi->netfs.cache =
107121
fscache_acquire_cookie(tcon->fscache, 0,
108-
&cifsi->uniqueid, sizeof(cifsi->uniqueid),
122+
&key, sizeof(key),
109123
&cd, sizeof(cd),
110124
i_size_read(&cifsi->netfs.inode));
111125
if (cifsi->netfs.cache)

fs/smb/client/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,8 @@ cifs_find_inode(struct inode *inode, void *opaque)
13511351
{
13521352
struct cifs_fattr *fattr = opaque;
13531353

1354+
/* [!] The compared values must be the same in struct cifs_fscache_inode_key. */
1355+
13541356
/* don't match inode with different uniqueid */
13551357
if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
13561358
return 0;

fs/smb/client/trace.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(get_reparse_compound_enter);
375375
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter);
376376
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter);
377377
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter);
378+
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mknod_enter);
378379

379380
DECLARE_EVENT_CLASS(smb3_inf_compound_done_class,
380381
TP_PROTO(unsigned int xid,
@@ -415,7 +416,7 @@ DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_wsl_ea_compound_done);
415416
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done);
416417
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done);
417418
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done);
418-
419+
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mknod_done);
419420

420421
DECLARE_EVENT_CLASS(smb3_inf_compound_err_class,
421422
TP_PROTO(unsigned int xid,
@@ -461,6 +462,7 @@ DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_wsl_ea_compound_err);
461462
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err);
462463
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err);
463464
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err);
465+
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mknod_err);
464466

465467
/*
466468
* For logging SMB3 Status code and Command for responses which return errors

0 commit comments

Comments
 (0)