You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros are for debugging. Convert the names to a single more typical kernel style cifs_dbg macro. cERROR(1, ...) -> cifs_dbg(VFS, ...) cFYI(1, ...) -> cifs_dbg(FYI, ...) cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...) Move the terminating format newline from the macro to the call site. Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the "CIFS VFS: " prefix for VFS messages. Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y) $ size fs/cifs/cifs.ko* text data bss dec hex filename 265245 2525 132 267902 4167e fs/cifs/cifs.ko.new 268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old Other miscellaneous changes around these conversions: o Miscellaneous typo fixes o Add terminating \n's to almost all formats and remove them from the macros to be more kernel style like. A few formats previously had defective \n's o Remove unnecessary OOM messages as kmalloc() calls dump_stack o Coalesce formats to make grep easier, added missing spaces when coalescing formats o Use %s, __func__ instead of embedded function name o Removed unnecessary "cifs: " prefixes o Convert kzalloc with multiply to kcalloc o Remove unused cifswarn macro Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
committed by
Steve French
parent
f7f7c1850e
commit
f96637be08
+20
-20
@@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length,
|
||||
|
||||
/* GSSAPI header */
|
||||
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
|
||||
cFYI(1, "Error decoding negTokenInit header");
|
||||
cifs_dbg(FYI, "Error decoding negTokenInit header\n");
|
||||
return 0;
|
||||
} else if ((cls != ASN1_APL) || (con != ASN1_CON)
|
||||
|| (tag != ASN1_EOC)) {
|
||||
cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag);
|
||||
cifs_dbg(FYI, "cls = %d con = %d tag = %d\n", cls, con, tag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length,
|
||||
|
||||
/* SPNEGO OID not present or garbled -- bail out */
|
||||
if (!rc) {
|
||||
cFYI(1, "Error decoding negTokenInit header");
|
||||
cifs_dbg(FYI, "Error decoding negTokenInit header\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* SPNEGO */
|
||||
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
|
||||
cFYI(1, "Error decoding negTokenInit");
|
||||
cifs_dbg(FYI, "Error decoding negTokenInit\n");
|
||||
return 0;
|
||||
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|
||||
|| (tag != ASN1_EOC)) {
|
||||
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0",
|
||||
cls, con, tag, end, *end);
|
||||
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
|
||||
cls, con, tag, end, *end);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* negTokenInit */
|
||||
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
|
||||
cFYI(1, "Error decoding negTokenInit");
|
||||
cifs_dbg(FYI, "Error decoding negTokenInit\n");
|
||||
return 0;
|
||||
} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|
||||
|| (tag != ASN1_SEQ)) {
|
||||
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1",
|
||||
cls, con, tag, end, *end);
|
||||
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
|
||||
cls, con, tag, end, *end);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* sequence */
|
||||
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
|
||||
cFYI(1, "Error decoding 2nd part of negTokenInit");
|
||||
cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
|
||||
return 0;
|
||||
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|
||||
|| (tag != ASN1_EOC)) {
|
||||
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0",
|
||||
cls, con, tag, end, *end);
|
||||
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
|
||||
cls, con, tag, end, *end);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* sequence of */
|
||||
if (asn1_header_decode
|
||||
(&ctx, &sequence_end, &cls, &con, &tag) == 0) {
|
||||
cFYI(1, "Error decoding 2nd part of negTokenInit");
|
||||
cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
|
||||
return 0;
|
||||
} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|
||||
|| (tag != ASN1_SEQ)) {
|
||||
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1",
|
||||
cls, con, tag, end, *end);
|
||||
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
|
||||
cls, con, tag, end, *end);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
|
||||
while (!asn1_eoc_decode(&ctx, sequence_end)) {
|
||||
rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
|
||||
if (!rc) {
|
||||
cFYI(1, "Error decoding negTokenInit hdr exit2");
|
||||
cifs_dbg(FYI, "Error decoding negTokenInit hdr exit2\n");
|
||||
return 0;
|
||||
}
|
||||
if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
|
||||
if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {
|
||||
|
||||
cFYI(1, "OID len = %d oid = 0x%lx 0x%lx "
|
||||
"0x%lx 0x%lx", oidlen, *oid,
|
||||
*(oid + 1), *(oid + 2), *(oid + 3));
|
||||
cifs_dbg(FYI, "OID len = %d oid = 0x%lx 0x%lx 0x%lx 0x%lx\n",
|
||||
oidlen, *oid, *(oid + 1), *(oid + 2),
|
||||
*(oid + 3));
|
||||
|
||||
if (compare_oid(oid, oidlen, MSKRB5_OID,
|
||||
MSKRB5_OID_LEN))
|
||||
@@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
|
||||
kfree(oid);
|
||||
}
|
||||
} else {
|
||||
cFYI(1, "Should be an oid what is going on?");
|
||||
cifs_dbg(FYI, "Should be an oid what is going on?\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data,
|
||||
break;
|
||||
|
||||
default:
|
||||
cERROR(1, "Unknown network family '%d'", sa->sa_family);
|
||||
cifs_dbg(VFS, "Unknown network family '%d'\n", sa->sa_family);
|
||||
key_len = 0;
|
||||
break;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
|
||||
|
||||
sharename = extract_sharename(tcon->treeName);
|
||||
if (IS_ERR(sharename)) {
|
||||
cFYI(1, "%s: couldn't extract sharename", __func__);
|
||||
cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
|
||||
sharename = NULL;
|
||||
return 0;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
|
||||
pagevec_init(&pvec, 0);
|
||||
first = 0;
|
||||
|
||||
cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi);
|
||||
cifs_dbg(FYI, "%s: cifs inode 0x%p now uncached\n", __func__, cifsi);
|
||||
|
||||
for (;;) {
|
||||
nr_pages = pagevec_lookup(&pvec,
|
||||
|
||||
+42
-25
@@ -57,15 +57,32 @@ cifs_dump_mem(char *label, void *data, int length)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIFS_DEBUG
|
||||
void cifs_vfs_err(const char *fmt, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
||||
vaf.fmt = fmt;
|
||||
vaf.va = &args;
|
||||
|
||||
printk(KERN_ERR "CIFS VFS: %pV", &vaf);
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
#endif
|
||||
|
||||
void cifs_dump_detail(void *buf)
|
||||
{
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
struct smb_hdr *smb = (struct smb_hdr *)buf;
|
||||
|
||||
cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d",
|
||||
smb->Command, smb->Status.CifsError,
|
||||
smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
|
||||
cERROR(1, "smb buf %p len %u", smb, smbCalcSize(smb));
|
||||
cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n",
|
||||
smb->Command, smb->Status.CifsError,
|
||||
smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
|
||||
cifs_dbg(VFS, "smb buf %p len %u\n", smb, smbCalcSize(smb));
|
||||
#endif /* CONFIG_CIFS_DEBUG2 */
|
||||
}
|
||||
|
||||
@@ -78,25 +95,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
|
||||
if (server == NULL)
|
||||
return;
|
||||
|
||||
cERROR(1, "Dump pending requests:");
|
||||
cifs_dbg(VFS, "Dump pending requests:\n");
|
||||
spin_lock(&GlobalMid_Lock);
|
||||
list_for_each(tmp, &server->pending_mid_q) {
|
||||
mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
|
||||
cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu",
|
||||
mid_entry->mid_state,
|
||||
le16_to_cpu(mid_entry->command),
|
||||
mid_entry->pid,
|
||||
mid_entry->callback_data,
|
||||
mid_entry->mid);
|
||||
cifs_dbg(VFS, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu\n",
|
||||
mid_entry->mid_state,
|
||||
le16_to_cpu(mid_entry->command),
|
||||
mid_entry->pid,
|
||||
mid_entry->callback_data,
|
||||
mid_entry->mid);
|
||||
#ifdef CONFIG_CIFS_STATS2
|
||||
cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld",
|
||||
mid_entry->large_buf,
|
||||
mid_entry->resp_buf,
|
||||
mid_entry->when_received,
|
||||
jiffies);
|
||||
cifs_dbg(VFS, "IsLarge: %d buf: %p time rcv: %ld now: %ld\n",
|
||||
mid_entry->large_buf,
|
||||
mid_entry->resp_buf,
|
||||
mid_entry->when_received,
|
||||
jiffies);
|
||||
#endif /* STATS2 */
|
||||
cERROR(1, "IsMult: %d IsEnd: %d", mid_entry->multiRsp,
|
||||
mid_entry->multiEnd);
|
||||
cifs_dbg(VFS, "IsMult: %d IsEnd: %d\n",
|
||||
mid_entry->multiRsp, mid_entry->multiEnd);
|
||||
if (mid_entry->resp_buf) {
|
||||
cifs_dump_detail(mid_entry->resp_buf);
|
||||
cifs_dump_mem("existing buf: ",
|
||||
@@ -603,7 +620,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
|
||||
global_secflags = CIFSSEC_MAX;
|
||||
return count;
|
||||
} else if (!isdigit(c)) {
|
||||
cERROR(1, "invalid flag %c", c);
|
||||
cifs_dbg(VFS, "invalid flag %c\n", c);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -611,16 +628,16 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
|
||||
|
||||
flags = simple_strtoul(flags_string, NULL, 0);
|
||||
|
||||
cFYI(1, "sec flags 0x%x", flags);
|
||||
cifs_dbg(FYI, "sec flags 0x%x\n", flags);
|
||||
|
||||
if (flags <= 0) {
|
||||
cERROR(1, "invalid security flags %s", flags_string);
|
||||
cifs_dbg(VFS, "invalid security flags %s\n", flags_string);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (flags & ~CIFSSEC_MASK) {
|
||||
cERROR(1, "attempt to set unsupported security flags 0x%x",
|
||||
flags & ~CIFSSEC_MASK);
|
||||
cifs_dbg(VFS, "attempt to set unsupported security flags 0x%x\n",
|
||||
flags & ~CIFSSEC_MASK);
|
||||
return -EINVAL;
|
||||
}
|
||||
/* flags look ok - update the global security flags for cifs module */
|
||||
@@ -628,9 +645,9 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
|
||||
if (global_secflags & CIFSSEC_MUST_SIGN) {
|
||||
/* requiring signing implies signing is allowed */
|
||||
global_secflags |= CIFSSEC_MAY_SIGN;
|
||||
cFYI(1, "packet signing now required");
|
||||
cifs_dbg(FYI, "packet signing now required\n");
|
||||
} else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) {
|
||||
cFYI(1, "packet signing disabled");
|
||||
cifs_dbg(FYI, "packet signing disabled\n");
|
||||
}
|
||||
/* BB should we turn on MAY flags for other MUST options? */
|
||||
return count;
|
||||
|
||||
+23
-47
@@ -25,18 +25,20 @@
|
||||
void cifs_dump_mem(char *label, void *data, int length);
|
||||
void cifs_dump_detail(void *);
|
||||
void cifs_dump_mids(struct TCP_Server_Info *);
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
#define DBG2 2
|
||||
#else
|
||||
#define DBG2 0
|
||||
#endif
|
||||
extern int traceSMB; /* flag which enables the function below */
|
||||
void dump_smb(void *, int);
|
||||
#define CIFS_INFO 0x01
|
||||
#define CIFS_RC 0x02
|
||||
#define CIFS_TIMER 0x04
|
||||
|
||||
#define VFS 1
|
||||
#define FYI 2
|
||||
extern int cifsFYI;
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
#define NOISY 4
|
||||
#else
|
||||
#define NOISY 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* debug ON
|
||||
@@ -44,31 +46,21 @@ extern int cifsFYI;
|
||||
*/
|
||||
#ifdef CONFIG_CIFS_DEBUG
|
||||
|
||||
__printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
|
||||
|
||||
/* information message: e.g., configuration, major event */
|
||||
#define cifsfyi(fmt, ...) \
|
||||
#define cifs_dbg(type, fmt, ...) \
|
||||
do { \
|
||||
if (cifsFYI & CIFS_INFO) \
|
||||
printk(KERN_DEBUG "%s: " fmt "\n", \
|
||||
__FILE__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define cFYI(set, fmt, ...) \
|
||||
do { \
|
||||
if (set) \
|
||||
cifsfyi(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define cifswarn(fmt, ...) \
|
||||
printk(KERN_WARNING fmt "\n", ##__VA_ARGS__)
|
||||
|
||||
/* error event message: e.g., i/o error */
|
||||
#define cifserror(fmt, ...) \
|
||||
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
|
||||
|
||||
#define cERROR(set, fmt, ...) \
|
||||
do { \
|
||||
if (set) \
|
||||
cifserror(fmt, ##__VA_ARGS__); \
|
||||
if (type == FYI) { \
|
||||
if (cifsFYI & CIFS_INFO) { \
|
||||
printk(KERN_DEBUG "%s: " fmt, \
|
||||
__FILE__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} else if (type == VFS) { \
|
||||
cifs_vfs_err(fmt, ##__VA_ARGS__); \
|
||||
} else if (type == NOISY && type != 0) { \
|
||||
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@@ -76,27 +68,11 @@ do { \
|
||||
* ---------
|
||||
*/
|
||||
#else /* _CIFS_DEBUG */
|
||||
#define cifsfyi(fmt, ...) \
|
||||
#define cifs_dbg(type, fmt, ...) \
|
||||
do { \
|
||||
if (0) \
|
||||
printk(KERN_DEBUG "%s: " fmt "\n", \
|
||||
__FILE__, ##__VA_ARGS__); \
|
||||
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define cFYI(set, fmt, ...) \
|
||||
do { \
|
||||
if (0 && set) \
|
||||
cifsfyi(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define cifserror(fmt, ...) \
|
||||
do { \
|
||||
if (0) \
|
||||
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define cERROR(set, fmt, ...) \
|
||||
do { \
|
||||
if (0 && set) \
|
||||
cifserror(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#endif /* _CIFS_DEBUG */
|
||||
#endif
|
||||
|
||||
#endif /* _H_CIFS_DEBUG */
|
||||
|
||||
+21
-20
@@ -84,8 +84,8 @@ static char *cifs_get_share_name(const char *node_name)
|
||||
/* find server name end */
|
||||
pSep = memchr(UNC+2, '\\', len-2);
|
||||
if (!pSep) {
|
||||
cERROR(1, "%s: no server name end in node name: %s",
|
||||
__func__, node_name);
|
||||
cifs_dbg(VFS, "%s: no server name end in node name: %s\n",
|
||||
__func__, node_name);
|
||||
kfree(UNC);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
@@ -141,8 +141,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
|
||||
|
||||
rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
|
||||
if (rc < 0) {
|
||||
cFYI(1, "%s: Failed to resolve server part of %s to IP: %d",
|
||||
__func__, *devname, rc);
|
||||
cifs_dbg(FYI, "%s: Failed to resolve server part of %s to IP: %d\n",
|
||||
__func__, *devname, rc);
|
||||
goto compose_mount_options_err;
|
||||
}
|
||||
|
||||
@@ -216,8 +216,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
|
||||
strcat(mountdata, fullpath + ref->path_consumed);
|
||||
}
|
||||
|
||||
/*cFYI(1, "%s: parent mountdata: %s", __func__,sb_mountdata);*/
|
||||
/*cFYI(1, "%s: submount mountdata: %s", __func__, mountdata );*/
|
||||
/*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/
|
||||
/*cifs_dbg(FYI, "%s: submount mountdata: %s\n", __func__, mountdata );*/
|
||||
|
||||
compose_mount_options_out:
|
||||
kfree(srvIP);
|
||||
@@ -260,11 +260,12 @@ static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
|
||||
|
||||
static void dump_referral(const struct dfs_info3_param *ref)
|
||||
{
|
||||
cFYI(1, "DFS: ref path: %s", ref->path_name);
|
||||
cFYI(1, "DFS: node path: %s", ref->node_name);
|
||||
cFYI(1, "DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type);
|
||||
cFYI(1, "DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag,
|
||||
ref->path_consumed);
|
||||
cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name);
|
||||
cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name);
|
||||
cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n",
|
||||
ref->flags, ref->server_type);
|
||||
cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n",
|
||||
ref->ref_flag, ref->path_consumed);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -283,7 +284,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
|
||||
struct vfsmount *mnt;
|
||||
struct tcon_link *tlink;
|
||||
|
||||
cFYI(1, "in %s", __func__);
|
||||
cifs_dbg(FYI, "in %s\n", __func__);
|
||||
BUG_ON(IS_ROOT(mntpt));
|
||||
|
||||
/*
|
||||
@@ -320,15 +321,15 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
|
||||
/* connect to a node */
|
||||
len = strlen(referrals[i].node_name);
|
||||
if (len < 2) {
|
||||
cERROR(1, "%s: Net Address path too short: %s",
|
||||
__func__, referrals[i].node_name);
|
||||
cifs_dbg(VFS, "%s: Net Address path too short: %s\n",
|
||||
__func__, referrals[i].node_name);
|
||||
mnt = ERR_PTR(-EINVAL);
|
||||
break;
|
||||
}
|
||||
mnt = cifs_dfs_do_refmount(cifs_sb,
|
||||
full_path, referrals + i);
|
||||
cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__,
|
||||
referrals[i].node_name, mnt);
|
||||
cifs_dbg(FYI, "%s: cifs_dfs_do_refmount:%s , mnt:%p\n",
|
||||
__func__, referrals[i].node_name, mnt);
|
||||
if (!IS_ERR(mnt))
|
||||
goto success;
|
||||
}
|
||||
@@ -343,7 +344,7 @@ success:
|
||||
free_full_path:
|
||||
kfree(full_path);
|
||||
cdda_exit:
|
||||
cFYI(1, "leaving %s" , __func__);
|
||||
cifs_dbg(FYI, "leaving %s\n" , __func__);
|
||||
return mnt;
|
||||
}
|
||||
|
||||
@@ -354,11 +355,11 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
|
||||
{
|
||||
struct vfsmount *newmnt;
|
||||
|
||||
cFYI(1, "in %s", __func__);
|
||||
cifs_dbg(FYI, "in %s\n", __func__);
|
||||
|
||||
newmnt = cifs_dfs_do_automount(path->dentry);
|
||||
if (IS_ERR(newmnt)) {
|
||||
cFYI(1, "leaving %s [automount failed]" , __func__);
|
||||
cifs_dbg(FYI, "leaving %s [automount failed]\n" , __func__);
|
||||
return newmnt;
|
||||
}
|
||||
|
||||
@@ -366,7 +367,7 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
|
||||
mnt_set_expiry(newmnt, &cifs_dfs_automount_list);
|
||||
schedule_delayed_work(&cifs_dfs_automount_task,
|
||||
cifs_dfs_mountpoint_expiry_timeout);
|
||||
cFYI(1, "leaving %s [ok]" , __func__);
|
||||
cifs_dbg(FYI, "leaving %s [ok]\n" , __func__);
|
||||
return newmnt;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
|
||||
dp = description + strlen(description);
|
||||
sprintf(dp, ";pid=0x%x", current->pid);
|
||||
|
||||
cFYI(1, "key description = %s", description);
|
||||
cifs_dbg(FYI, "key description = %s\n", description);
|
||||
spnego_key = request_key(&cifs_spnego_key_type, description, "");
|
||||
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
|
||||
@@ -227,8 +227,8 @@ cifs_strtoUTF16(__le16 *to, const char *from, int len,
|
||||
for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
|
||||
charlen = codepage->char2uni(from, len, &wchar_to);
|
||||
if (charlen < 1) {
|
||||
cERROR(1, "strtoUTF16: char2uni of 0x%x returned %d",
|
||||
*from, charlen);
|
||||
cifs_dbg(VFS, "strtoUTF16: char2uni of 0x%x returned %d\n",
|
||||
*from, charlen);
|
||||
/* A question mark */
|
||||
wchar_to = 0x003f;
|
||||
charlen = 1;
|
||||
|
||||
+64
-63
@@ -218,13 +218,13 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
|
||||
sidkey = request_key(&cifs_idmap_key_type, desc, "");
|
||||
if (IS_ERR(sidkey)) {
|
||||
rc = -EINVAL;
|
||||
cFYI(1, "%s: Can't map %cid %u to a SID", __func__,
|
||||
sidtype == SIDOWNER ? 'u' : 'g', cid);
|
||||
cifs_dbg(FYI, "%s: Can't map %cid %u to a SID\n",
|
||||
__func__, sidtype == SIDOWNER ? 'u' : 'g', cid);
|
||||
goto out_revert_creds;
|
||||
} else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
|
||||
rc = -EIO;
|
||||
cFYI(1, "%s: Downcall contained malformed key "
|
||||
"(datalen=%hu)", __func__, sidkey->datalen);
|
||||
cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
|
||||
__func__, sidkey->datalen);
|
||||
goto invalidate_key;
|
||||
}
|
||||
|
||||
@@ -240,8 +240,8 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
|
||||
ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32));
|
||||
if (ksid_size > sidkey->datalen) {
|
||||
rc = -EIO;
|
||||
cFYI(1, "%s: Downcall contained malformed key (datalen=%hu, "
|
||||
"ksid_size=%u)", __func__, sidkey->datalen, ksid_size);
|
||||
cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu, ksid_size=%u)\n",
|
||||
__func__, sidkey->datalen, ksid_size);
|
||||
goto invalidate_key;
|
||||
}
|
||||
|
||||
@@ -273,8 +273,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
|
||||
* Just return an error.
|
||||
*/
|
||||
if (unlikely(psid->num_subauth > SID_MAX_SUB_AUTHORITIES)) {
|
||||
cFYI(1, "%s: %u subauthorities is too many!", __func__,
|
||||
psid->num_subauth);
|
||||
cifs_dbg(FYI, "%s: %u subauthorities is too many!\n",
|
||||
__func__, psid->num_subauth);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -286,8 +286,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
|
||||
sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
|
||||
if (IS_ERR(sidkey)) {
|
||||
rc = -EINVAL;
|
||||
cFYI(1, "%s: Can't map SID %s to a %cid", __func__, sidstr,
|
||||
sidtype == SIDOWNER ? 'u' : 'g');
|
||||
cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",
|
||||
__func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g');
|
||||
goto out_revert_creds;
|
||||
}
|
||||
|
||||
@@ -299,8 +299,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
|
||||
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
|
||||
if (sidkey->datalen != sizeof(uid_t)) {
|
||||
rc = -EIO;
|
||||
cFYI(1, "%s: Downcall contained malformed key "
|
||||
"(datalen=%hu)", __func__, sidkey->datalen);
|
||||
cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
|
||||
__func__, sidkey->datalen);
|
||||
key_invalidate(sidkey);
|
||||
goto out_key_put;
|
||||
}
|
||||
@@ -345,7 +345,8 @@ init_cifs_idmap(void)
|
||||
struct key *keyring;
|
||||
int ret;
|
||||
|
||||
cFYI(1, "Registering the %s key type", cifs_idmap_key_type.name);
|
||||
cifs_dbg(FYI, "Registering the %s key type\n",
|
||||
cifs_idmap_key_type.name);
|
||||
|
||||
/* create an override credential set with a special thread keyring in
|
||||
* which requests are cached
|
||||
@@ -378,7 +379,7 @@ init_cifs_idmap(void)
|
||||
cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
|
||||
root_cred = cred;
|
||||
|
||||
cFYI(1, "cifs idmap keyring: %d", key_serial(keyring));
|
||||
cifs_dbg(FYI, "cifs idmap keyring: %d\n", key_serial(keyring));
|
||||
return 0;
|
||||
|
||||
failed_put_key:
|
||||
@@ -394,7 +395,7 @@ exit_cifs_idmap(void)
|
||||
key_revoke(root_cred->thread_keyring);
|
||||
unregister_key_type(&cifs_idmap_key_type);
|
||||
put_cred(root_cred);
|
||||
cFYI(1, "Unregistered %s key type", cifs_idmap_key_type.name);
|
||||
cifs_dbg(FYI, "Unregistered %s key type\n", cifs_idmap_key_type.name);
|
||||
}
|
||||
|
||||
/* copy ntsd, owner sid, and group sid from a security descriptor to another */
|
||||
@@ -461,14 +462,14 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
|
||||
*pbits_to_set &= ~S_IXUGO;
|
||||
return;
|
||||
} else if (type != ACCESS_ALLOWED) {
|
||||
cERROR(1, "unknown access control type %d", type);
|
||||
cifs_dbg(VFS, "unknown access control type %d\n", type);
|
||||
return;
|
||||
}
|
||||
/* else ACCESS_ALLOWED type */
|
||||
|
||||
if (flags & GENERIC_ALL) {
|
||||
*pmode |= (S_IRWXUGO & (*pbits_to_set));
|
||||
cFYI(DBG2, "all perms");
|
||||
cifs_dbg(NOISY, "all perms\n");
|
||||
return;
|
||||
}
|
||||
if ((flags & GENERIC_WRITE) ||
|
||||
@@ -481,7 +482,7 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
|
||||
((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
|
||||
*pmode |= (S_IXUGO & (*pbits_to_set));
|
||||
|
||||
cFYI(DBG2, "access flags 0x%x mode now 0x%x", flags, *pmode);
|
||||
cifs_dbg(NOISY, "access flags 0x%x mode now 0x%x\n", flags, *pmode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -510,7 +511,8 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
|
||||
if (mode & S_IXUGO)
|
||||
*pace_flags |= SET_FILE_EXEC_RIGHTS;
|
||||
|
||||
cFYI(DBG2, "mode: 0x%x, access flags now 0x%x", mode, *pace_flags);
|
||||
cifs_dbg(NOISY, "mode: 0x%x, access flags now 0x%x\n",
|
||||
mode, *pace_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -550,24 +552,24 @@ static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
|
||||
/* validate that we do not go past end of acl */
|
||||
|
||||
if (le16_to_cpu(pace->size) < 16) {
|
||||
cERROR(1, "ACE too small %d", le16_to_cpu(pace->size));
|
||||
cifs_dbg(VFS, "ACE too small %d\n", le16_to_cpu(pace->size));
|
||||
return;
|
||||
}
|
||||
|
||||
if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) {
|
||||
cERROR(1, "ACL too small to parse ACE");
|
||||
cifs_dbg(VFS, "ACL too small to parse ACE\n");
|
||||
return;
|
||||
}
|
||||
|
||||
num_subauth = pace->sid.num_subauth;
|
||||
if (num_subauth) {
|
||||
int i;
|
||||
cFYI(1, "ACE revision %d num_auth %d type %d flags %d size %d",
|
||||
pace->sid.revision, pace->sid.num_subauth, pace->type,
|
||||
pace->flags, le16_to_cpu(pace->size));
|
||||
cifs_dbg(FYI, "ACE revision %d num_auth %d type %d flags %d size %d\n",
|
||||
pace->sid.revision, pace->sid.num_subauth, pace->type,
|
||||
pace->flags, le16_to_cpu(pace->size));
|
||||
for (i = 0; i < num_subauth; ++i) {
|
||||
cFYI(1, "ACE sub_auth[%d]: 0x%x", i,
|
||||
le32_to_cpu(pace->sid.sub_auth[i]));
|
||||
cifs_dbg(FYI, "ACE sub_auth[%d]: 0x%x\n",
|
||||
i, le32_to_cpu(pace->sid.sub_auth[i]));
|
||||
}
|
||||
|
||||
/* BB add length check to make sure that we do not have huge
|
||||
@@ -600,13 +602,13 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
|
||||
|
||||
/* validate that we do not go past end of acl */
|
||||
if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
|
||||
cERROR(1, "ACL too small to parse DACL");
|
||||
cifs_dbg(VFS, "ACL too small to parse DACL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
cFYI(DBG2, "DACL revision %d size %d num aces %d",
|
||||
le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
|
||||
le32_to_cpu(pdacl->num_aces));
|
||||
cifs_dbg(NOISY, "DACL revision %d size %d num aces %d\n",
|
||||
le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
|
||||
le32_to_cpu(pdacl->num_aces));
|
||||
|
||||
/* reset rwx permissions for user/group/other.
|
||||
Also, if num_aces is 0 i.e. DACL has no ACEs,
|
||||
@@ -626,10 +628,8 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
|
||||
return;
|
||||
ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
|
||||
GFP_KERNEL);
|
||||
if (!ppace) {
|
||||
cERROR(1, "DACL memory allocation error");
|
||||
if (!ppace)
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_aces; ++i) {
|
||||
ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
|
||||
@@ -702,25 +702,25 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
|
||||
/* validate that we do not go past end of ACL - sid must be at least 8
|
||||
bytes long (assuming no sub-auths - e.g. the null SID */
|
||||
if (end_of_acl < (char *)psid + 8) {
|
||||
cERROR(1, "ACL too small to parse SID %p", psid);
|
||||
cifs_dbg(VFS, "ACL too small to parse SID %p\n", psid);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
if (psid->num_subauth) {
|
||||
int i;
|
||||
cFYI(1, "SID revision %d num_auth %d",
|
||||
psid->revision, psid->num_subauth);
|
||||
cifs_dbg(FYI, "SID revision %d num_auth %d\n",
|
||||
psid->revision, psid->num_subauth);
|
||||
|
||||
for (i = 0; i < psid->num_subauth; i++) {
|
||||
cFYI(1, "SID sub_auth[%d]: 0x%x ", i,
|
||||
le32_to_cpu(psid->sub_auth[i]));
|
||||
cifs_dbg(FYI, "SID sub_auth[%d]: 0x%x\n",
|
||||
i, le32_to_cpu(psid->sub_auth[i]));
|
||||
}
|
||||
|
||||
/* BB add length check to make sure that we do not have huge
|
||||
num auths and therefore go off the end */
|
||||
cFYI(1, "RID 0x%x",
|
||||
le32_to_cpu(psid->sub_auth[psid->num_subauth-1]));
|
||||
cifs_dbg(FYI, "RID 0x%x\n",
|
||||
le32_to_cpu(psid->sub_auth[psid->num_subauth-1]));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -747,31 +747,33 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
|
||||
le32_to_cpu(pntsd->gsidoffset));
|
||||
dacloffset = le32_to_cpu(pntsd->dacloffset);
|
||||
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
|
||||
cFYI(DBG2, "revision %d type 0x%x ooffset 0x%x goffset 0x%x "
|
||||
"sacloffset 0x%x dacloffset 0x%x",
|
||||
cifs_dbg(NOISY, "revision %d type 0x%x ooffset 0x%x goffset 0x%x sacloffset 0x%x dacloffset 0x%x\n",
|
||||
pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
|
||||
le32_to_cpu(pntsd->gsidoffset),
|
||||
le32_to_cpu(pntsd->sacloffset), dacloffset);
|
||||
/* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */
|
||||
rc = parse_sid(owner_sid_ptr, end_of_acl);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Error %d parsing Owner SID", __func__, rc);
|
||||
cifs_dbg(FYI, "%s: Error %d parsing Owner SID\n", __func__, rc);
|
||||
return rc;
|
||||
}
|
||||
rc = sid_to_id(cifs_sb, owner_sid_ptr, fattr, SIDOWNER);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Error %d mapping Owner SID to uid", __func__, rc);
|
||||
cifs_dbg(FYI, "%s: Error %d mapping Owner SID to uid\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = parse_sid(group_sid_ptr, end_of_acl);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Error %d mapping Owner SID to gid", __func__, rc);
|
||||
cifs_dbg(FYI, "%s: Error %d mapping Owner SID to gid\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
rc = sid_to_id(cifs_sb, group_sid_ptr, fattr, SIDGROUP);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Error %d mapping Group SID to gid", __func__, rc);
|
||||
cifs_dbg(FYI, "%s: Error %d mapping Group SID to gid\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -779,7 +781,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
|
||||
parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr,
|
||||
group_sid_ptr, fattr);
|
||||
else
|
||||
cFYI(1, "no ACL"); /* BB grant all or default perms? */
|
||||
cifs_dbg(FYI, "no ACL\n"); /* BB grant all or default perms? */
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -829,8 +831,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
|
||||
id = from_kuid(&init_user_ns, uid);
|
||||
rc = id_to_sid(id, SIDOWNER, nowner_sid_ptr);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Mapping error %d for owner id %d",
|
||||
__func__, rc, id);
|
||||
cifs_dbg(FYI, "%s: Mapping error %d for owner id %d\n",
|
||||
__func__, rc, id);
|
||||
kfree(nowner_sid_ptr);
|
||||
return rc;
|
||||
}
|
||||
@@ -849,8 +851,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
|
||||
id = from_kgid(&init_user_ns, gid);
|
||||
rc = id_to_sid(id, SIDGROUP, ngroup_sid_ptr);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Mapping error %d for group id %d",
|
||||
__func__, rc, id);
|
||||
cifs_dbg(FYI, "%s: Mapping error %d for group id %d\n",
|
||||
__func__, rc, id);
|
||||
kfree(ngroup_sid_ptr);
|
||||
return rc;
|
||||
}
|
||||
@@ -880,7 +882,7 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
|
||||
|
||||
cifs_put_tlink(tlink);
|
||||
|
||||
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
|
||||
cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
|
||||
if (rc)
|
||||
return ERR_PTR(rc);
|
||||
return pntsd;
|
||||
@@ -917,7 +919,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
|
||||
cifs_put_tlink(tlink);
|
||||
free_xid(xid);
|
||||
|
||||
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
|
||||
cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
|
||||
if (rc)
|
||||
return ERR_PTR(rc);
|
||||
return pntsd;
|
||||
@@ -971,12 +973,12 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
|
||||
create_options, &fid, &oplock, NULL, cifs_sb->local_nls,
|
||||
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
||||
if (rc) {
|
||||
cERROR(1, "Unable to open file to set ACL");
|
||||
cifs_dbg(VFS, "Unable to open file to set ACL\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = CIFSSMBSetCIFSACL(xid, tcon, fid, pnntsd, acllen, aclflag);
|
||||
cFYI(DBG2, "SetCIFSACL rc = %d", rc);
|
||||
cifs_dbg(NOISY, "SetCIFSACL rc = %d\n", rc);
|
||||
|
||||
CIFSSMBClose(xid, tcon, fid);
|
||||
out:
|
||||
@@ -994,7 +996,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
|
||||
u32 acllen = 0;
|
||||
int rc = 0;
|
||||
|
||||
cFYI(DBG2, "converting ACL to mode for %s", path);
|
||||
cifs_dbg(NOISY, "converting ACL to mode for %s\n", path);
|
||||
|
||||
if (pfid)
|
||||
pntsd = get_cifs_acl_by_fid(cifs_sb, *pfid, &acllen);
|
||||
@@ -1004,12 +1006,12 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
|
||||
/* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
|
||||
if (IS_ERR(pntsd)) {
|
||||
rc = PTR_ERR(pntsd);
|
||||
cERROR(1, "%s: error %d getting sec desc", __func__, rc);
|
||||
cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
|
||||
} else {
|
||||
rc = parse_sec_desc(cifs_sb, pntsd, acllen, fattr);
|
||||
kfree(pntsd);
|
||||
if (rc)
|
||||
cERROR(1, "parse sec desc failed rc = %d", rc);
|
||||
cifs_dbg(VFS, "parse sec desc failed rc = %d\n", rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -1026,13 +1028,13 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
|
||||
struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
|
||||
struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
|
||||
|
||||
cFYI(DBG2, "set ACL from mode for %s", path);
|
||||
cifs_dbg(NOISY, "set ACL from mode for %s\n", path);
|
||||
|
||||
/* Get the security descriptor */
|
||||
pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen);
|
||||
if (IS_ERR(pntsd)) {
|
||||
rc = PTR_ERR(pntsd);
|
||||
cERROR(1, "%s: error %d getting sec desc", __func__, rc);
|
||||
cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1045,7 +1047,6 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
|
||||
secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN);
|
||||
pnntsd = kmalloc(secdesclen, GFP_KERNEL);
|
||||
if (!pnntsd) {
|
||||
cERROR(1, "Unable to allocate security descriptor");
|
||||
kfree(pntsd);
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -1053,12 +1054,12 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
|
||||
rc = build_sec_desc(pntsd, pnntsd, secdesclen, nmode, uid, gid,
|
||||
&aclflag);
|
||||
|
||||
cFYI(DBG2, "build_sec_desc rc: %d", rc);
|
||||
cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);
|
||||
|
||||
if (!rc) {
|
||||
/* Set the security descriptor */
|
||||
rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag);
|
||||
cFYI(DBG2, "set_cifs_acl rc: %d", rc);
|
||||
cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);
|
||||
}
|
||||
|
||||
kfree(pnntsd);
|
||||
|
||||
+49
-53
@@ -50,20 +50,20 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
|
||||
return -EINVAL;
|
||||
|
||||
if (!server->secmech.sdescmd5) {
|
||||
cERROR(1, "%s: Can't generate signature", __func__);
|
||||
cifs_dbg(VFS, "%s: Can't generate signature\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = crypto_shash_init(&server->secmech.sdescmd5->shash);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not init md5", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = crypto_shash_update(&server->secmech.sdescmd5->shash,
|
||||
server->session_key.response, server->session_key.len);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with response", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
|
||||
if (iov[i].iov_len == 0)
|
||||
continue;
|
||||
if (iov[i].iov_base == NULL) {
|
||||
cERROR(1, "null iovec entry");
|
||||
cifs_dbg(VFS, "null iovec entry\n");
|
||||
return -EIO;
|
||||
}
|
||||
/* The first entry includes a length field (which does not get
|
||||
@@ -88,8 +88,8 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
|
||||
iov[i].iov_base, iov[i].iov_len);
|
||||
}
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with payload",
|
||||
__func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with payload\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
|
||||
|
||||
rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature);
|
||||
if (rc)
|
||||
cERROR(1, "%s: Could not generate md5 hash", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -196,8 +196,8 @@ int cifs_verify_signature(struct smb_rqst *rqst,
|
||||
|
||||
/* Do not need to verify session setups with signature "BSRSPYL " */
|
||||
if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0)
|
||||
cFYI(1, "dummy signature received for smb command 0x%x",
|
||||
cifs_pdu->Command);
|
||||
cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
|
||||
cifs_pdu->Command);
|
||||
|
||||
/* save off the origiginal signature so we can modify the smb and check
|
||||
its signature against what the server sent */
|
||||
@@ -235,30 +235,30 @@ int setup_ntlm_response(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
return -EINVAL;
|
||||
|
||||
ses->auth_key.response = kmalloc(temp_len, GFP_KERNEL);
|
||||
if (!ses->auth_key.response) {
|
||||
cERROR(1, "NTLM can't allocate (%u bytes) memory", temp_len);
|
||||
if (!ses->auth_key.response)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ses->auth_key.len = temp_len;
|
||||
|
||||
rc = SMBNTencrypt(ses->password, ses->server->cryptkey,
|
||||
ses->auth_key.response + CIFS_SESS_KEY_SIZE, nls_cp);
|
||||
if (rc) {
|
||||
cFYI(1, "%s Can't generate NTLM response, error: %d",
|
||||
__func__, rc);
|
||||
cifs_dbg(FYI, "%s Can't generate NTLM response, error: %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = E_md4hash(ses->password, temp_key, nls_cp);
|
||||
if (rc) {
|
||||
cFYI(1, "%s Can't generate NT hash, error: %d", __func__, rc);
|
||||
cifs_dbg(FYI, "%s Can't generate NT hash, error: %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = mdfour(ses->auth_key.response, temp_key, CIFS_SESS_KEY_SIZE);
|
||||
if (rc)
|
||||
cFYI(1, "%s Can't generate NTLM session key, error: %d",
|
||||
__func__, rc);
|
||||
cifs_dbg(FYI, "%s Can't generate NTLM session key, error: %d\n",
|
||||
__func__, rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -334,7 +334,6 @@ build_avpair_blob(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL);
|
||||
if (!ses->auth_key.response) {
|
||||
ses->auth_key.len = 0;
|
||||
cERROR(1, "Challenge target info allocation failure");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -420,7 +419,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
wchar_t *server;
|
||||
|
||||
if (!ses->server->secmech.sdeschmacmd5) {
|
||||
cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash");
|
||||
cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -430,13 +429,13 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, nt_hash,
|
||||
CIFS_NTHASH_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not set NT Hash as a key", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not set NT Hash as a key\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
|
||||
if (rc) {
|
||||
cERROR(1, "calc_ntlmv2_hash: could not init hmacmd5");
|
||||
cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -444,7 +443,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
len = ses->user_name ? strlen(ses->user_name) : 0;
|
||||
user = kmalloc(2 + (len * 2), GFP_KERNEL);
|
||||
if (user == NULL) {
|
||||
cERROR(1, "calc_ntlmv2_hash: user mem alloc failure");
|
||||
rc = -ENOMEM;
|
||||
return rc;
|
||||
}
|
||||
@@ -460,7 +458,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
(char *)user, 2 * len);
|
||||
kfree(user);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with user", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with user\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -470,7 +468,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
|
||||
domain = kmalloc(2 + (len * 2), GFP_KERNEL);
|
||||
if (domain == NULL) {
|
||||
cERROR(1, "calc_ntlmv2_hash: domain mem alloc failure");
|
||||
rc = -ENOMEM;
|
||||
return rc;
|
||||
}
|
||||
@@ -481,8 +478,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
(char *)domain, 2 * len);
|
||||
kfree(domain);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with domain",
|
||||
__func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with domain\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
} else if (ses->serverName) {
|
||||
@@ -490,7 +487,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
|
||||
server = kmalloc(2 + (len * 2), GFP_KERNEL);
|
||||
if (server == NULL) {
|
||||
cERROR(1, "calc_ntlmv2_hash: server mem alloc failure");
|
||||
rc = -ENOMEM;
|
||||
return rc;
|
||||
}
|
||||
@@ -501,8 +497,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
(char *)server, 2 * len);
|
||||
kfree(server);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with server",
|
||||
__func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with server\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@@ -510,7 +506,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
|
||||
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
|
||||
ntlmv2_hash);
|
||||
if (rc)
|
||||
cERROR(1, "%s: Could not generate md5 hash", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -522,20 +518,21 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
|
||||
unsigned int offset = CIFS_SESS_KEY_SIZE + 8;
|
||||
|
||||
if (!ses->server->secmech.sdeschmacmd5) {
|
||||
cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash");
|
||||
cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
|
||||
ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
|
||||
if (rc) {
|
||||
cERROR(1, "CalcNTLMv2_response: could not init hmacmd5");
|
||||
cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -548,14 +545,14 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
|
||||
rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
|
||||
ses->auth_key.response + offset, ses->auth_key.len - offset);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with response", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
|
||||
ses->auth_key.response + CIFS_SESS_KEY_SIZE);
|
||||
if (rc)
|
||||
cERROR(1, "%s: Could not generate md5 hash", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -575,14 +572,15 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
if (!ses->domainName) {
|
||||
rc = find_domain_name(ses, nls_cp);
|
||||
if (rc) {
|
||||
cERROR(1, "error %d finding domain name", rc);
|
||||
cifs_dbg(VFS, "error %d finding domain name\n",
|
||||
rc);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rc = build_avpair_blob(ses, nls_cp);
|
||||
if (rc) {
|
||||
cERROR(1, "error %d building av pair blob", rc);
|
||||
cifs_dbg(VFS, "error %d building av pair blob\n", rc);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
}
|
||||
@@ -595,7 +593,6 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
if (!ses->auth_key.response) {
|
||||
rc = ENOMEM;
|
||||
ses->auth_key.len = 0;
|
||||
cERROR(1, "%s: Can't allocate auth blob", __func__);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
ses->auth_key.len += baselen;
|
||||
@@ -613,14 +610,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
/* calculate ntlmv2_hash */
|
||||
rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp);
|
||||
if (rc) {
|
||||
cERROR(1, "could not get v2 hash rc %d", rc);
|
||||
cifs_dbg(VFS, "could not get v2 hash rc %d\n", rc);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
|
||||
/* calculate first part of the client response (CR1) */
|
||||
rc = CalcNTLMv2_response(ses, ntlmv2_hash);
|
||||
if (rc) {
|
||||
cERROR(1, "Could not calculate CR1 rc: %d", rc);
|
||||
cifs_dbg(VFS, "Could not calculate CR1 rc: %d\n", rc);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
|
||||
@@ -628,13 +625,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
|
||||
ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
|
||||
__func__);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
|
||||
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not init hmacmd5", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
|
||||
@@ -642,14 +640,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
|
||||
ses->auth_key.response + CIFS_SESS_KEY_SIZE,
|
||||
CIFS_HMAC_MD5_HASH_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not update with response", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
|
||||
goto setup_ntlmv2_rsp_ret;
|
||||
}
|
||||
|
||||
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
|
||||
ses->auth_key.response);
|
||||
if (rc)
|
||||
cERROR(1, "%s: Could not generate md5 hash", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
|
||||
|
||||
setup_ntlmv2_rsp_ret:
|
||||
kfree(tiblob);
|
||||
@@ -671,7 +669,7 @@ calc_seckey(struct cifs_ses *ses)
|
||||
tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
|
||||
if (IS_ERR(tfm_arc4)) {
|
||||
rc = PTR_ERR(tfm_arc4);
|
||||
cERROR(1, "could not allocate crypto API arc4");
|
||||
cifs_dbg(VFS, "could not allocate crypto API arc4\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -680,7 +678,8 @@ calc_seckey(struct cifs_ses *ses)
|
||||
rc = crypto_blkcipher_setkey(tfm_arc4, ses->auth_key.response,
|
||||
CIFS_SESS_KEY_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: Could not set response as a key", __func__);
|
||||
cifs_dbg(VFS, "%s: Could not set response as a key\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -689,7 +688,7 @@ calc_seckey(struct cifs_ses *ses)
|
||||
|
||||
rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE);
|
||||
if (rc) {
|
||||
cERROR(1, "could not encrypt session key rc: %d", rc);
|
||||
cifs_dbg(VFS, "could not encrypt session key rc: %d\n", rc);
|
||||
crypto_free_blkcipher(tfm_arc4);
|
||||
return rc;
|
||||
}
|
||||
@@ -731,20 +730,20 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
|
||||
|
||||
server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0);
|
||||
if (IS_ERR(server->secmech.hmacmd5)) {
|
||||
cERROR(1, "could not allocate crypto hmacmd5");
|
||||
cifs_dbg(VFS, "could not allocate crypto hmacmd5\n");
|
||||
return PTR_ERR(server->secmech.hmacmd5);
|
||||
}
|
||||
|
||||
server->secmech.md5 = crypto_alloc_shash("md5", 0, 0);
|
||||
if (IS_ERR(server->secmech.md5)) {
|
||||
cERROR(1, "could not allocate crypto md5");
|
||||
cifs_dbg(VFS, "could not allocate crypto md5\n");
|
||||
rc = PTR_ERR(server->secmech.md5);
|
||||
goto crypto_allocate_md5_fail;
|
||||
}
|
||||
|
||||
server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0);
|
||||
if (IS_ERR(server->secmech.hmacsha256)) {
|
||||
cERROR(1, "could not allocate crypto hmacsha256\n");
|
||||
cifs_dbg(VFS, "could not allocate crypto hmacsha256\n");
|
||||
rc = PTR_ERR(server->secmech.hmacsha256);
|
||||
goto crypto_allocate_hmacsha256_fail;
|
||||
}
|
||||
@@ -753,7 +752,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
|
||||
crypto_shash_descsize(server->secmech.hmacmd5);
|
||||
server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL);
|
||||
if (!server->secmech.sdeschmacmd5) {
|
||||
cERROR(1, "cifs_crypto_shash_allocate: can't alloc hmacmd5");
|
||||
rc = -ENOMEM;
|
||||
goto crypto_allocate_hmacmd5_sdesc_fail;
|
||||
}
|
||||
@@ -764,7 +762,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
|
||||
crypto_shash_descsize(server->secmech.md5);
|
||||
server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL);
|
||||
if (!server->secmech.sdescmd5) {
|
||||
cERROR(1, "cifs_crypto_shash_allocate: can't alloc md5");
|
||||
rc = -ENOMEM;
|
||||
goto crypto_allocate_md5_sdesc_fail;
|
||||
}
|
||||
@@ -775,7 +772,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
|
||||
crypto_shash_descsize(server->secmech.hmacsha256);
|
||||
server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL);
|
||||
if (!server->secmech.sdeschmacsha256) {
|
||||
cERROR(1, "%s: Can't alloc hmacsha256\n", __func__);
|
||||
rc = -ENOMEM;
|
||||
goto crypto_allocate_hmacsha256_sdesc_fail;
|
||||
}
|
||||
|
||||
+21
-15
@@ -161,7 +161,7 @@ cifs_read_super(struct super_block *sb)
|
||||
|
||||
#ifdef CONFIG_CIFS_NFSD_EXPORT
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
|
||||
cFYI(1, "export ops supported");
|
||||
cifs_dbg(FYI, "export ops supported\n");
|
||||
sb->s_export_op = &cifs_export_ops;
|
||||
}
|
||||
#endif /* CONFIG_CIFS_NFSD_EXPORT */
|
||||
@@ -169,7 +169,7 @@ cifs_read_super(struct super_block *sb)
|
||||
return 0;
|
||||
|
||||
out_no_root:
|
||||
cERROR(1, "cifs_read_super: get root inode failed");
|
||||
cifs_dbg(VFS, "%s: get root inode failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ static void cifs_umount_begin(struct super_block *sb)
|
||||
/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
|
||||
/* cancel_notify_requests(tcon); */
|
||||
if (tcon->ses && tcon->ses->server) {
|
||||
cFYI(1, "wake up tasks now - umount begin not complete");
|
||||
cifs_dbg(FYI, "wake up tasks now - umount begin not complete\n");
|
||||
wake_up_all(&tcon->ses->server->request_q);
|
||||
wake_up_all(&tcon->ses->server->response_q);
|
||||
msleep(1); /* yield */
|
||||
@@ -573,7 +573,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
|
||||
if (full_path == NULL)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
cFYI(1, "Get root dentry for %s", full_path);
|
||||
cifs_dbg(FYI, "Get root dentry for %s\n", full_path);
|
||||
|
||||
sep = CIFS_DIR_SEP(cifs_sb);
|
||||
dentry = dget(sb->s_root);
|
||||
@@ -632,7 +632,7 @@ cifs_do_mount(struct file_system_type *fs_type,
|
||||
struct cifs_mnt_data mnt_data;
|
||||
struct dentry *root;
|
||||
|
||||
cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
|
||||
cifs_dbg(FYI, "Devname: %s flags: %d\n", dev_name, flags);
|
||||
|
||||
volume_info = cifs_get_volume_info((char *)data, dev_name);
|
||||
if (IS_ERR(volume_info))
|
||||
@@ -655,7 +655,8 @@ cifs_do_mount(struct file_system_type *fs_type,
|
||||
rc = cifs_mount(cifs_sb, volume_info);
|
||||
if (rc) {
|
||||
if (!(flags & MS_SILENT))
|
||||
cERROR(1, "cifs_mount failed w/return code = %d", rc);
|
||||
cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
|
||||
rc);
|
||||
root = ERR_PTR(rc);
|
||||
goto out_mountdata;
|
||||
}
|
||||
@@ -675,7 +676,7 @@ cifs_do_mount(struct file_system_type *fs_type,
|
||||
}
|
||||
|
||||
if (sb->s_root) {
|
||||
cFYI(1, "Use existing superblock");
|
||||
cifs_dbg(FYI, "Use existing superblock\n");
|
||||
cifs_umount(cifs_sb);
|
||||
} else {
|
||||
rc = cifs_read_super(sb);
|
||||
@@ -691,7 +692,7 @@ cifs_do_mount(struct file_system_type *fs_type,
|
||||
if (IS_ERR(root))
|
||||
goto out_super;
|
||||
|
||||
cFYI(1, "dentry root is: %p", root);
|
||||
cifs_dbg(FYI, "dentry root is: %p\n", root);
|
||||
goto out;
|
||||
|
||||
out_super:
|
||||
@@ -723,7 +724,8 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
||||
|
||||
rc = filemap_fdatawrite(inode->i_mapping);
|
||||
if (rc)
|
||||
cFYI(1, "cifs_file_aio_write: %d rc on %p inode", rc, inode);
|
||||
cifs_dbg(FYI, "cifs_file_aio_write: %d rc on %p inode\n",
|
||||
rc, inode);
|
||||
|
||||
return written;
|
||||
}
|
||||
@@ -1030,7 +1032,10 @@ cifs_init_request_bufs(void)
|
||||
} else {
|
||||
CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
|
||||
}
|
||||
/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */
|
||||
/*
|
||||
cifs_dbg(VFS, "CIFSMaxBufSize %d 0x%x\n",
|
||||
CIFSMaxBufSize, CIFSMaxBufSize);
|
||||
*/
|
||||
cifs_req_cachep = kmem_cache_create("cifs_request",
|
||||
CIFSMaxBufSize + max_hdr_size, 0,
|
||||
SLAB_HWCACHE_ALIGN, NULL);
|
||||
@@ -1041,7 +1046,7 @@ cifs_init_request_bufs(void)
|
||||
cifs_min_rcv = 1;
|
||||
else if (cifs_min_rcv > 64) {
|
||||
cifs_min_rcv = 64;
|
||||
cERROR(1, "cifs_min_rcv set to maximum (64)");
|
||||
cifs_dbg(VFS, "cifs_min_rcv set to maximum (64)\n");
|
||||
}
|
||||
|
||||
cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
|
||||
@@ -1072,7 +1077,7 @@ cifs_init_request_bufs(void)
|
||||
cifs_min_small = 2;
|
||||
else if (cifs_min_small > 256) {
|
||||
cifs_min_small = 256;
|
||||
cFYI(1, "cifs_min_small set to maximum (256)");
|
||||
cifs_dbg(FYI, "cifs_min_small set to maximum (256)\n");
|
||||
}
|
||||
|
||||
cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
|
||||
@@ -1163,10 +1168,11 @@ init_cifs(void)
|
||||
|
||||
if (cifs_max_pending < 2) {
|
||||
cifs_max_pending = 2;
|
||||
cFYI(1, "cifs_max_pending set to min of 2");
|
||||
cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
|
||||
} else if (cifs_max_pending > CIFS_MAX_REQ) {
|
||||
cifs_max_pending = CIFS_MAX_REQ;
|
||||
cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ);
|
||||
cifs_dbg(FYI, "cifs_max_pending set to max of %u\n",
|
||||
CIFS_MAX_REQ);
|
||||
}
|
||||
|
||||
cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
|
||||
@@ -1235,7 +1241,7 @@ out_clean_proc:
|
||||
static void __exit
|
||||
exit_cifs(void)
|
||||
{
|
||||
cFYI(DBG2, "exit_cifs");
|
||||
cifs_dbg(NOISY, "exit_cifs\n");
|
||||
unregister_filesystem(&cifs_fs_type);
|
||||
cifs_dfs_release_automount_timer();
|
||||
#ifdef CONFIG_CIFS_ACL
|
||||
|
||||
+5
-5
@@ -45,17 +45,17 @@ extern void _free_xid(unsigned int);
|
||||
#define get_xid() \
|
||||
({ \
|
||||
unsigned int __xid = _get_xid(); \
|
||||
cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \
|
||||
__func__, __xid, \
|
||||
from_kuid(&init_user_ns, current_fsuid())); \
|
||||
cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n", \
|
||||
__func__, __xid, \
|
||||
from_kuid(&init_user_ns, current_fsuid())); \
|
||||
__xid; \
|
||||
})
|
||||
|
||||
#define free_xid(curr_xid) \
|
||||
do { \
|
||||
_free_xid(curr_xid); \
|
||||
cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \
|
||||
__func__, curr_xid, (int)rc); \
|
||||
cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n", \
|
||||
__func__, curr_xid, (int)rc); \
|
||||
} while (0)
|
||||
extern int init_cifs_idmap(void);
|
||||
extern void exit_cifs_idmap(void);
|
||||
|
||||
+244
-239
File diff suppressed because it is too large
Load Diff
+149
-161
File diff suppressed because it is too large
Load Diff
+23
-21
@@ -102,7 +102,7 @@ cifs_bp_rename_retry:
|
||||
namelen += (1 + temp->d_name.len);
|
||||
temp = temp->d_parent;
|
||||
if (temp == NULL) {
|
||||
cERROR(1, "corrupt dentry");
|
||||
cifs_dbg(VFS, "corrupt dentry\n");
|
||||
rcu_read_unlock();
|
||||
return NULL;
|
||||
}
|
||||
@@ -124,12 +124,12 @@ cifs_bp_rename_retry:
|
||||
full_path[namelen] = dirsep;
|
||||
strncpy(full_path + namelen + 1, temp->d_name.name,
|
||||
temp->d_name.len);
|
||||
cFYI(0, "name: %s", full_path + namelen);
|
||||
cifs_dbg(FYI, "name: %s\n", full_path + namelen);
|
||||
}
|
||||
spin_unlock(&temp->d_lock);
|
||||
temp = temp->d_parent;
|
||||
if (temp == NULL) {
|
||||
cERROR(1, "corrupt dentry");
|
||||
cifs_dbg(VFS, "corrupt dentry\n");
|
||||
rcu_read_unlock();
|
||||
kfree(full_path);
|
||||
return NULL;
|
||||
@@ -137,8 +137,8 @@ cifs_bp_rename_retry:
|
||||
}
|
||||
rcu_read_unlock();
|
||||
if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
|
||||
cFYI(1, "did not end path lookup where expected. namelen=%d "
|
||||
"dfsplen=%d", namelen, dfsplen);
|
||||
cifs_dbg(FYI, "did not end path lookup where expected. namelen=%ddfsplen=%d\n",
|
||||
namelen, dfsplen);
|
||||
/* presumably this is only possible if racing with a rename
|
||||
of one of the parent directories (we can not lock the dentries
|
||||
above us to prevent this, but retrying should be harmless) */
|
||||
@@ -178,7 +178,7 @@ check_name(struct dentry *direntry)
|
||||
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
|
||||
for (i = 0; i < direntry->d_name.len; i++) {
|
||||
if (direntry->d_name.name[i] == '\\') {
|
||||
cFYI(1, "Invalid file name");
|
||||
cifs_dbg(FYI, "Invalid file name\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
|
||||
else if ((oflags & O_CREAT) == O_CREAT)
|
||||
disposition = FILE_OPEN_IF;
|
||||
else
|
||||
cFYI(1, "Create flag not set in create function");
|
||||
cifs_dbg(FYI, "Create flag not set in create function\n");
|
||||
|
||||
/*
|
||||
* BB add processing to set equivalent of mode - e.g. via CreateX with
|
||||
@@ -323,7 +323,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
|
||||
desired_access, create_options, fid, oplock,
|
||||
buf, cifs_sb);
|
||||
if (rc) {
|
||||
cFYI(1, "cifs_create returned 0x%x", rc);
|
||||
cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,8 @@ cifs_create_get_file_info:
|
||||
|
||||
cifs_create_set_dentry:
|
||||
if (rc != 0) {
|
||||
cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
|
||||
cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
|
||||
rc);
|
||||
if (server->ops->close)
|
||||
server->ops->close(xid, tcon, fid);
|
||||
goto out;
|
||||
@@ -452,8 +453,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
|
||||
inode, direntry->d_name.name, direntry);
|
||||
cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
|
||||
inode, direntry->d_name.name, direntry);
|
||||
|
||||
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
|
||||
if (IS_ERR(tlink))
|
||||
@@ -518,8 +519,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
|
||||
__u32 oplock;
|
||||
int created = FILE_CREATED;
|
||||
|
||||
cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p",
|
||||
inode, direntry->d_name.name, direntry);
|
||||
cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
|
||||
inode, direntry->d_name.name, direntry);
|
||||
|
||||
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
|
||||
rc = PTR_ERR(tlink);
|
||||
@@ -613,7 +614,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
|
||||
goto mknod_out;
|
||||
|
||||
|
||||
cFYI(1, "sfu compat create special file");
|
||||
cifs_dbg(FYI, "sfu compat create special file\n");
|
||||
|
||||
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
|
||||
if (buf == NULL) {
|
||||
@@ -688,8 +689,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
|
||||
parent_dir_inode, direntry->d_name.name, direntry);
|
||||
cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
|
||||
parent_dir_inode, direntry->d_name.name, direntry);
|
||||
|
||||
/* check whether path exists */
|
||||
|
||||
@@ -715,11 +716,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
|
||||
}
|
||||
|
||||
if (direntry->d_inode != NULL) {
|
||||
cFYI(1, "non-NULL inode in lookup");
|
||||
cifs_dbg(FYI, "non-NULL inode in lookup\n");
|
||||
} else {
|
||||
cFYI(1, "NULL inode in lookup");
|
||||
cifs_dbg(FYI, "NULL inode in lookup\n");
|
||||
}
|
||||
cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode);
|
||||
cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
|
||||
full_path, direntry->d_inode);
|
||||
|
||||
if (pTcon->unix_ext) {
|
||||
rc = cifs_get_inode_info_unix(&newInode, full_path,
|
||||
@@ -742,7 +744,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
|
||||
/* if it was once a directory (but how can we tell?) we could do
|
||||
shrink_dcache_parent(direntry); */
|
||||
} else if (rc != -EACCES) {
|
||||
cERROR(1, "Unexpected lookup error %d", rc);
|
||||
cifs_dbg(VFS, "Unexpected lookup error %d\n", rc);
|
||||
/* We special case check for Access Denied - since that
|
||||
is a common return code */
|
||||
}
|
||||
@@ -807,7 +809,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name);
|
||||
cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
|
||||
|
||||
return rc;
|
||||
} */
|
||||
|
||||
@@ -55,7 +55,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
|
||||
|
||||
len = strlen(unc);
|
||||
if (len < 3) {
|
||||
cFYI(1, "%s: unc is too short: %s", __func__, unc);
|
||||
cifs_dbg(FYI, "%s: unc is too short: %s\n", __func__, unc);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
|
||||
if (sep)
|
||||
len = sep - hostname;
|
||||
else
|
||||
cFYI(1, "%s: probably server name is whole unc: %s",
|
||||
__func__, unc);
|
||||
cifs_dbg(FYI, "%s: probably server name is whole unc: %s\n",
|
||||
__func__, unc);
|
||||
|
||||
/* Try to interpret hostname as an IPv4 or IPv6 address */
|
||||
rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len);
|
||||
@@ -79,11 +79,11 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
|
||||
/* Perform the upcall */
|
||||
rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
|
||||
if (rc < 0)
|
||||
cFYI(1, "%s: unable to resolve: %*.*s",
|
||||
__func__, len, len, hostname);
|
||||
cifs_dbg(FYI, "%s: unable to resolve: %*.*s\n",
|
||||
__func__, len, len, hostname);
|
||||
else
|
||||
cFYI(1, "%s: resolved: %*.*s to %s",
|
||||
__func__, len, len, hostname, *ip_addr);
|
||||
cifs_dbg(FYI, "%s: resolved: %*.*s to %s\n",
|
||||
__func__, len, len, hostname, *ip_addr);
|
||||
return rc;
|
||||
|
||||
name_is_IP_address:
|
||||
@@ -92,7 +92,8 @@ name_is_IP_address:
|
||||
return -ENOMEM;
|
||||
memcpy(name, hostname, len);
|
||||
name[len] = 0;
|
||||
cFYI(1, "%s: unc is IP, skipping dns upcall: %s", __func__, name);
|
||||
cifs_dbg(FYI, "%s: unc is IP, skipping dns upcall: %s\n",
|
||||
__func__, name);
|
||||
*ip_addr = name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
static struct dentry *cifs_get_parent(struct dentry *dentry)
|
||||
{
|
||||
/* BB need to add code here eventually to enable export via NFSD */
|
||||
cFYI(1, "get parent for %p", dentry);
|
||||
cifs_dbg(FYI, "get parent for %p\n", dentry);
|
||||
return ERR_PTR(-EACCES);
|
||||
}
|
||||
|
||||
|
||||
+81
-85
@@ -78,9 +78,8 @@ static u32 cifs_posix_convert_flags(unsigned int flags)
|
||||
if (flags & O_EXCL)
|
||||
posix_flags |= SMB_O_EXCL;
|
||||
} else if (flags & O_EXCL)
|
||||
cFYI(1, "Application %s pid %d has incorrectly set O_EXCL flag"
|
||||
"but not O_CREAT on file open. Ignoring O_EXCL",
|
||||
current->comm, current->tgid);
|
||||
cifs_dbg(FYI, "Application %s pid %d has incorrectly set O_EXCL flag but not O_CREAT on file open. Ignoring O_EXCL\n",
|
||||
current->comm, current->tgid);
|
||||
|
||||
if (flags & O_TRUNC)
|
||||
posix_flags |= SMB_O_TRUNC;
|
||||
@@ -123,7 +122,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
|
||||
struct tcon_link *tlink;
|
||||
struct cifs_tcon *tcon;
|
||||
|
||||
cFYI(1, "posix open %s", full_path);
|
||||
cifs_dbg(FYI, "posix open %s\n", full_path);
|
||||
|
||||
presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
|
||||
if (presp_data == NULL)
|
||||
@@ -308,7 +307,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
|
||||
*/
|
||||
if (oplock == server->vals->oplock_read &&
|
||||
cifs_has_mand_locks(cinode)) {
|
||||
cFYI(1, "Reset oplock val from read to None due to mand locks");
|
||||
cifs_dbg(FYI, "Reset oplock val from read to None due to mand locks\n");
|
||||
oplock = 0;
|
||||
}
|
||||
|
||||
@@ -374,8 +373,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
|
||||
list_del(&cifs_file->tlist);
|
||||
|
||||
if (list_empty(&cifsi->openFileList)) {
|
||||
cFYI(1, "closing last open instance for inode %p",
|
||||
cifs_file->dentry->d_inode);
|
||||
cifs_dbg(FYI, "closing last open instance for inode %p\n",
|
||||
cifs_file->dentry->d_inode);
|
||||
/*
|
||||
* In strict cache mode we need invalidate mapping on the last
|
||||
* close because it may cause a error when we open this file
|
||||
@@ -454,7 +453,7 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||
goto out;
|
||||
}
|
||||
|
||||
cFYI(1, "inode = 0x%p file flags are 0x%x for %s",
|
||||
cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
|
||||
inode, file->f_flags, full_path);
|
||||
|
||||
if (server->oplocks)
|
||||
@@ -470,16 +469,13 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||
cifs_sb->mnt_file_mode /* ignored */,
|
||||
file->f_flags, &oplock, &fid.netfid, xid);
|
||||
if (rc == 0) {
|
||||
cFYI(1, "posix open succeeded");
|
||||
cifs_dbg(FYI, "posix open succeeded\n");
|
||||
posix_open_ok = true;
|
||||
} else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
|
||||
if (tcon->ses->serverNOS)
|
||||
cERROR(1, "server %s of type %s returned"
|
||||
" unexpected error on SMB posix open"
|
||||
", disabling posix open support."
|
||||
" Check if server update available.",
|
||||
tcon->ses->serverName,
|
||||
tcon->ses->serverNOS);
|
||||
cifs_dbg(VFS, "server %s of type %s returned unexpected error on SMB posix open, disabling posix open support. Check if server update available.\n",
|
||||
tcon->ses->serverName,
|
||||
tcon->ses->serverNOS);
|
||||
tcon->broken_posix_open = true;
|
||||
} else if ((rc != -EIO) && (rc != -EREMOTE) &&
|
||||
(rc != -EOPNOTSUPP)) /* path not found or net err */
|
||||
@@ -621,8 +617,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
|
||||
return rc;
|
||||
}
|
||||
|
||||
cFYI(1, "inode = 0x%p file flags 0x%x for %s", inode, cfile->f_flags,
|
||||
full_path);
|
||||
cifs_dbg(FYI, "inode = 0x%p file flags 0x%x for %s\n",
|
||||
inode, cfile->f_flags, full_path);
|
||||
|
||||
if (tcon->ses->server->oplocks)
|
||||
oplock = REQ_OPLOCK;
|
||||
@@ -643,7 +639,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
|
||||
cifs_sb->mnt_file_mode /* ignored */,
|
||||
oflags, &oplock, &fid.netfid, xid);
|
||||
if (rc == 0) {
|
||||
cFYI(1, "posix reopen succeeded");
|
||||
cifs_dbg(FYI, "posix reopen succeeded\n");
|
||||
goto reopen_success;
|
||||
}
|
||||
/*
|
||||
@@ -672,8 +668,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
|
||||
NULL, cifs_sb);
|
||||
if (rc) {
|
||||
mutex_unlock(&cfile->fh_mutex);
|
||||
cFYI(1, "cifs_reopen returned 0x%x", rc);
|
||||
cFYI(1, "oplock: %d", oplock);
|
||||
cifs_dbg(FYI, "cifs_reopen returned 0x%x\n", rc);
|
||||
cifs_dbg(FYI, "oplock: %d\n", oplock);
|
||||
goto reopen_error_exit;
|
||||
}
|
||||
|
||||
@@ -729,7 +725,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||
struct TCP_Server_Info *server;
|
||||
char *buf;
|
||||
|
||||
cFYI(1, "Closedir inode = 0x%p", inode);
|
||||
cifs_dbg(FYI, "Closedir inode = 0x%p\n", inode);
|
||||
|
||||
if (cfile == NULL)
|
||||
return rc;
|
||||
@@ -738,7 +734,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||
tcon = tlink_tcon(cfile->tlink);
|
||||
server = tcon->ses->server;
|
||||
|
||||
cFYI(1, "Freeing private data in close dir");
|
||||
cifs_dbg(FYI, "Freeing private data in close dir\n");
|
||||
spin_lock(&cifs_file_list_lock);
|
||||
if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
|
||||
cfile->invalidHandle = true;
|
||||
@@ -747,7 +743,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||
rc = server->ops->close_dir(xid, tcon, &cfile->fid);
|
||||
else
|
||||
rc = -ENOSYS;
|
||||
cFYI(1, "Closing uncompleted readdir with rc %d", rc);
|
||||
cifs_dbg(FYI, "Closing uncompleted readdir with rc %d\n", rc);
|
||||
/* not much we can do if it fails anyway, ignore rc */
|
||||
rc = 0;
|
||||
} else
|
||||
@@ -755,7 +751,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||
|
||||
buf = cfile->srch_inf.ntwrk_buf_start;
|
||||
if (buf) {
|
||||
cFYI(1, "closedir free smb buf in srch struct");
|
||||
cifs_dbg(FYI, "closedir free smb buf in srch struct\n");
|
||||
cfile->srch_inf.ntwrk_buf_start = NULL;
|
||||
if (cfile->srch_inf.smallBuf)
|
||||
cifs_small_buf_release(buf);
|
||||
@@ -1140,7 +1136,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
|
||||
* The list ended. We don't have enough allocated
|
||||
* structures - something is really wrong.
|
||||
*/
|
||||
cERROR(1, "Can't push all brlocks!");
|
||||
cifs_dbg(VFS, "Can't push all brlocks!\n");
|
||||
break;
|
||||
}
|
||||
length = 1 + flock->fl_end - flock->fl_start;
|
||||
@@ -1213,47 +1209,46 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
|
||||
bool *wait_flag, struct TCP_Server_Info *server)
|
||||
{
|
||||
if (flock->fl_flags & FL_POSIX)
|
||||
cFYI(1, "Posix");
|
||||
cifs_dbg(FYI, "Posix\n");
|
||||
if (flock->fl_flags & FL_FLOCK)
|
||||
cFYI(1, "Flock");
|
||||
cifs_dbg(FYI, "Flock\n");
|
||||
if (flock->fl_flags & FL_SLEEP) {
|
||||
cFYI(1, "Blocking lock");
|
||||
cifs_dbg(FYI, "Blocking lock\n");
|
||||
*wait_flag = true;
|
||||
}
|
||||
if (flock->fl_flags & FL_ACCESS)
|
||||
cFYI(1, "Process suspended by mandatory locking - "
|
||||
"not implemented yet");
|
||||
cifs_dbg(FYI, "Process suspended by mandatory locking - not implemented yet\n");
|
||||
if (flock->fl_flags & FL_LEASE)
|
||||
cFYI(1, "Lease on file - not implemented yet");
|
||||
cifs_dbg(FYI, "Lease on file - not implemented yet\n");
|
||||
if (flock->fl_flags &
|
||||
(~(FL_POSIX | FL_FLOCK | FL_SLEEP |
|
||||
FL_ACCESS | FL_LEASE | FL_CLOSE)))
|
||||
cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags);
|
||||
cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags);
|
||||
|
||||
*type = server->vals->large_lock_type;
|
||||
if (flock->fl_type == F_WRLCK) {
|
||||
cFYI(1, "F_WRLCK ");
|
||||
cifs_dbg(FYI, "F_WRLCK\n");
|
||||
*type |= server->vals->exclusive_lock_type;
|
||||
*lock = 1;
|
||||
} else if (flock->fl_type == F_UNLCK) {
|
||||
cFYI(1, "F_UNLCK");
|
||||
cifs_dbg(FYI, "F_UNLCK\n");
|
||||
*type |= server->vals->unlock_lock_type;
|
||||
*unlock = 1;
|
||||
/* Check if unlock includes more than one lock range */
|
||||
} else if (flock->fl_type == F_RDLCK) {
|
||||
cFYI(1, "F_RDLCK");
|
||||
cifs_dbg(FYI, "F_RDLCK\n");
|
||||
*type |= server->vals->shared_lock_type;
|
||||
*lock = 1;
|
||||
} else if (flock->fl_type == F_EXLCK) {
|
||||
cFYI(1, "F_EXLCK");
|
||||
cifs_dbg(FYI, "F_EXLCK\n");
|
||||
*type |= server->vals->exclusive_lock_type;
|
||||
*lock = 1;
|
||||
} else if (flock->fl_type == F_SHLCK) {
|
||||
cFYI(1, "F_SHLCK");
|
||||
cifs_dbg(FYI, "F_SHLCK\n");
|
||||
*type |= server->vals->shared_lock_type;
|
||||
*lock = 1;
|
||||
} else
|
||||
cFYI(1, "Unknown type of lock");
|
||||
cifs_dbg(FYI, "Unknown type of lock\n");
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1296,8 +1291,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
|
||||
type, 0, 1, false);
|
||||
flock->fl_type = F_UNLCK;
|
||||
if (rc != 0)
|
||||
cERROR(1, "Error unlocking previously locked "
|
||||
"range %d during test of lock", rc);
|
||||
cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
|
||||
rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1316,8 +1311,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
|
||||
type | server->vals->shared_lock_type, 0, 1, false);
|
||||
flock->fl_type = F_RDLCK;
|
||||
if (rc != 0)
|
||||
cERROR(1, "Error unlocking previously locked "
|
||||
"range %d during test of lock", rc);
|
||||
cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
|
||||
rc);
|
||||
} else
|
||||
flock->fl_type = F_WRLCK;
|
||||
|
||||
@@ -1508,8 +1503,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
|
||||
if (!CIFS_I(inode)->clientCanCacheAll &&
|
||||
CIFS_I(inode)->clientCanCacheRead) {
|
||||
cifs_invalidate_mapping(inode);
|
||||
cFYI(1, "Set no oplock for inode=%p due to mand locks",
|
||||
inode);
|
||||
cifs_dbg(FYI, "Set no oplock for inode=%p due to mand locks\n",
|
||||
inode);
|
||||
CIFS_I(inode)->clientCanCacheRead = false;
|
||||
}
|
||||
|
||||
@@ -1546,9 +1541,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
|
||||
rc = -EACCES;
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld "
|
||||
"end: %lld", cmd, flock->fl_flags, flock->fl_type,
|
||||
flock->fl_start, flock->fl_end);
|
||||
cifs_dbg(FYI, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld end: %lld\n",
|
||||
cmd, flock->fl_flags, flock->fl_type,
|
||||
flock->fl_start, flock->fl_end);
|
||||
|
||||
cfile = (struct cifsFileInfo *)file->private_data;
|
||||
tcon = tlink_tcon(cfile->tlink);
|
||||
@@ -1620,8 +1615,8 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
|
||||
|
||||
cifs_sb = CIFS_SB(dentry->d_sb);
|
||||
|
||||
cFYI(1, "write %zd bytes to offset %lld of %s", write_size,
|
||||
*offset, dentry->d_name.name);
|
||||
cifs_dbg(FYI, "write %zd bytes to offset %lld of %s\n",
|
||||
write_size, *offset, dentry->d_name.name);
|
||||
|
||||
tcon = tlink_tcon(open_file->tlink);
|
||||
server = tcon->ses->server;
|
||||
@@ -1736,7 +1731,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
|
||||
it being zero) during stress testcases so we need to check for it */
|
||||
|
||||
if (cifs_inode == NULL) {
|
||||
cERROR(1, "Null inode passed to cifs_writeable_file");
|
||||
cifs_dbg(VFS, "Null inode passed to cifs_writeable_file\n");
|
||||
dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
@@ -1848,7 +1843,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
|
||||
else if (bytes_written < 0)
|
||||
rc = bytes_written;
|
||||
} else {
|
||||
cFYI(1, "No writeable filehandles for inode");
|
||||
cifs_dbg(FYI, "No writeable filehandles for inode\n");
|
||||
rc = -EIO;
|
||||
}
|
||||
|
||||
@@ -2015,7 +2010,7 @@ retry:
|
||||
wdata->cfile = find_writable_file(CIFS_I(mapping->host),
|
||||
false);
|
||||
if (!wdata->cfile) {
|
||||
cERROR(1, "No writable handles for inode");
|
||||
cifs_dbg(VFS, "No writable handles for inode\n");
|
||||
rc = -EBADF;
|
||||
break;
|
||||
}
|
||||
@@ -2076,7 +2071,7 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
|
||||
/* BB add check for wbc flags */
|
||||
page_cache_get(page);
|
||||
if (!PageUptodate(page))
|
||||
cFYI(1, "ppw - page not up to date");
|
||||
cifs_dbg(FYI, "ppw - page not up to date\n");
|
||||
|
||||
/*
|
||||
* Set the "writeback" flag, and clear "dirty" in the radix tree.
|
||||
@@ -2127,7 +2122,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
|
||||
else
|
||||
pid = current->tgid;
|
||||
|
||||
cFYI(1, "write_end for page %p from pos %lld with %d bytes",
|
||||
cifs_dbg(FYI, "write_end for page %p from pos %lld with %d bytes\n",
|
||||
page, pos, copied);
|
||||
|
||||
if (PageChecked(page)) {
|
||||
@@ -2191,13 +2186,13 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "Sync file - name: %s datasync: 0x%x",
|
||||
file->f_path.dentry->d_name.name, datasync);
|
||||
cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
|
||||
file->f_path.dentry->d_name.name, datasync);
|
||||
|
||||
if (!CIFS_I(inode)->clientCanCacheRead) {
|
||||
rc = cifs_invalidate_mapping(inode);
|
||||
if (rc) {
|
||||
cFYI(1, "rc: %d during invalidate phase", rc);
|
||||
cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc);
|
||||
rc = 0; /* don't care about it in fsync */
|
||||
}
|
||||
}
|
||||
@@ -2233,8 +2228,8 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "Sync file - name: %s datasync: 0x%x",
|
||||
file->f_path.dentry->d_name.name, datasync);
|
||||
cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
|
||||
file->f_path.dentry->d_name.name, datasync);
|
||||
|
||||
tcon = tlink_tcon(smbfile->tlink);
|
||||
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) {
|
||||
@@ -2262,7 +2257,7 @@ int cifs_flush(struct file *file, fl_owner_t id)
|
||||
if (file->f_mode & FMODE_WRITE)
|
||||
rc = filemap_write_and_wait(inode->i_mapping);
|
||||
|
||||
cFYI(1, "Flush inode %p file %p rc %d", inode, file, rc);
|
||||
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -2579,8 +2574,8 @@ cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
|
||||
* an old data.
|
||||
*/
|
||||
cifs_invalidate_mapping(inode);
|
||||
cFYI(1, "Set no oplock for inode=%p after a write operation",
|
||||
inode);
|
||||
cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n",
|
||||
inode);
|
||||
cinode->clientCanCacheRead = false;
|
||||
}
|
||||
return written;
|
||||
@@ -2756,15 +2751,15 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server,
|
||||
/* enough data to fill the page */
|
||||
iov.iov_base = kmap(page);
|
||||
iov.iov_len = PAGE_SIZE;
|
||||
cFYI(1, "%u: iov_base=%p iov_len=%zu",
|
||||
i, iov.iov_base, iov.iov_len);
|
||||
cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
|
||||
i, iov.iov_base, iov.iov_len);
|
||||
len -= PAGE_SIZE;
|
||||
} else if (len > 0) {
|
||||
/* enough for partial page, fill and zero the rest */
|
||||
iov.iov_base = kmap(page);
|
||||
iov.iov_len = len;
|
||||
cFYI(1, "%u: iov_base=%p iov_len=%zu",
|
||||
i, iov.iov_base, iov.iov_len);
|
||||
cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
|
||||
i, iov.iov_base, iov.iov_len);
|
||||
memset(iov.iov_base + len, '\0', PAGE_SIZE - len);
|
||||
rdata->tailsz = len;
|
||||
len = 0;
|
||||
@@ -2824,7 +2819,7 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
|
||||
pid = current->tgid;
|
||||
|
||||
if ((file->f_flags & O_ACCMODE) == O_WRONLY)
|
||||
cFYI(1, "attempting read on write only file instance");
|
||||
cifs_dbg(FYI, "attempting read on write only file instance\n");
|
||||
|
||||
do {
|
||||
cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize);
|
||||
@@ -3003,7 +2998,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
|
||||
pid = current->tgid;
|
||||
|
||||
if ((file->f_flags & O_ACCMODE) == O_WRONLY)
|
||||
cFYI(1, "attempting read on write only file instance");
|
||||
cifs_dbg(FYI, "attempting read on write only file instance\n");
|
||||
|
||||
for (total_read = 0, cur_offset = read_data; read_size > total_read;
|
||||
total_read += bytes_read, cur_offset += bytes_read) {
|
||||
@@ -3094,7 +3089,8 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
xid = get_xid();
|
||||
rc = cifs_revalidate_file(file);
|
||||
if (rc) {
|
||||
cFYI(1, "Validation prior to mmap failed, error=%d", rc);
|
||||
cifs_dbg(FYI, "Validation prior to mmap failed, error=%d\n",
|
||||
rc);
|
||||
free_xid(xid);
|
||||
return rc;
|
||||
}
|
||||
@@ -3147,7 +3143,7 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
|
||||
/* determine the eof that the server (probably) has */
|
||||
eof = CIFS_I(rdata->mapping->host)->server_eof;
|
||||
eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0;
|
||||
cFYI(1, "eof=%llu eof_index=%lu", eof, eof_index);
|
||||
cifs_dbg(FYI, "eof=%llu eof_index=%lu\n", eof, eof_index);
|
||||
|
||||
rdata->tailsz = PAGE_CACHE_SIZE;
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
@@ -3157,15 +3153,15 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
|
||||
/* enough data to fill the page */
|
||||
iov.iov_base = kmap(page);
|
||||
iov.iov_len = PAGE_CACHE_SIZE;
|
||||
cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu",
|
||||
i, page->index, iov.iov_base, iov.iov_len);
|
||||
cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
|
||||
i, page->index, iov.iov_base, iov.iov_len);
|
||||
len -= PAGE_CACHE_SIZE;
|
||||
} else if (len > 0) {
|
||||
/* enough for partial page, fill and zero the rest */
|
||||
iov.iov_base = kmap(page);
|
||||
iov.iov_len = len;
|
||||
cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu",
|
||||
i, page->index, iov.iov_base, iov.iov_len);
|
||||
cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
|
||||
i, page->index, iov.iov_base, iov.iov_len);
|
||||
memset(iov.iov_base + len,
|
||||
'\0', PAGE_CACHE_SIZE - len);
|
||||
rdata->tailsz = len;
|
||||
@@ -3245,8 +3241,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
|
||||
rc = 0;
|
||||
INIT_LIST_HEAD(&tmplist);
|
||||
|
||||
cFYI(1, "%s: file=%p mapping=%p num_pages=%u", __func__, file,
|
||||
mapping, num_pages);
|
||||
cifs_dbg(FYI, "%s: file=%p mapping=%p num_pages=%u\n",
|
||||
__func__, file, mapping, num_pages);
|
||||
|
||||
/*
|
||||
* Start with the page at end of list and move it to private
|
||||
@@ -3376,7 +3372,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
|
||||
if (rc < 0)
|
||||
goto io_error;
|
||||
else
|
||||
cFYI(1, "Bytes read %d", rc);
|
||||
cifs_dbg(FYI, "Bytes read %d\n", rc);
|
||||
|
||||
file_inode(file)->i_atime =
|
||||
current_fs_time(file_inode(file)->i_sb);
|
||||
@@ -3414,7 +3410,7 @@ static int cifs_readpage(struct file *file, struct page *page)
|
||||
return rc;
|
||||
}
|
||||
|
||||
cFYI(1, "readpage %p at offset %d 0x%x",
|
||||
cifs_dbg(FYI, "readpage %p at offset %d 0x%x\n",
|
||||
page, (int)offset, (int)offset);
|
||||
|
||||
rc = cifs_readpage_worker(file, page, &offset);
|
||||
@@ -3481,7 +3477,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
|
||||
struct page *page;
|
||||
int rc = 0;
|
||||
|
||||
cFYI(1, "write_begin from %lld len %d", (long long)pos, len);
|
||||
cifs_dbg(FYI, "write_begin from %lld len %d\n", (long long)pos, len);
|
||||
|
||||
page = grab_cache_page_write_begin(mapping, index, flags);
|
||||
if (!page) {
|
||||
@@ -3570,7 +3566,7 @@ static int cifs_launder_page(struct page *page)
|
||||
.range_end = range_end,
|
||||
};
|
||||
|
||||
cFYI(1, "Launder page: %p", page);
|
||||
cifs_dbg(FYI, "Launder page: %p\n", page);
|
||||
|
||||
if (clear_page_dirty_for_io(page))
|
||||
rc = cifs_writepage_locked(page, &wbc);
|
||||
@@ -3590,8 +3586,8 @@ void cifs_oplock_break(struct work_struct *work)
|
||||
|
||||
if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead &&
|
||||
cifs_has_mand_locks(cinode)) {
|
||||
cFYI(1, "Reset oplock to None for inode=%p due to mand locks",
|
||||
inode);
|
||||
cifs_dbg(FYI, "Reset oplock to None for inode=%p due to mand locks\n",
|
||||
inode);
|
||||
cinode->clientCanCacheRead = false;
|
||||
}
|
||||
|
||||
@@ -3606,12 +3602,12 @@ void cifs_oplock_break(struct work_struct *work)
|
||||
mapping_set_error(inode->i_mapping, rc);
|
||||
cifs_invalidate_mapping(inode);
|
||||
}
|
||||
cFYI(1, "Oplock flush inode %p rc %d", inode, rc);
|
||||
cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc);
|
||||
}
|
||||
|
||||
rc = cifs_push_locks(cfile);
|
||||
if (rc)
|
||||
cERROR(1, "Push locks rc = %d", rc);
|
||||
cifs_dbg(VFS, "Push locks rc = %d\n", rc);
|
||||
|
||||
/*
|
||||
* releasing stale oplock after recent reconnect of smb session using
|
||||
@@ -3622,7 +3618,7 @@ void cifs_oplock_break(struct work_struct *work)
|
||||
if (!cfile->oplock_break_cancelled) {
|
||||
rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid,
|
||||
cinode);
|
||||
cFYI(1, "Oplock release rc = %d", rc);
|
||||
cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+29
-29
@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server)
|
||||
server->fscache =
|
||||
fscache_acquire_cookie(cifs_fscache_netfs.primary_index,
|
||||
&cifs_fscache_server_index_def, server);
|
||||
cFYI(1, "%s: (0x%p/0x%p)", __func__, server,
|
||||
server->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
|
||||
__func__, server, server->fscache);
|
||||
}
|
||||
|
||||
void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server)
|
||||
{
|
||||
cFYI(1, "%s: (0x%p/0x%p)", __func__, server,
|
||||
server->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
|
||||
__func__, server, server->fscache);
|
||||
fscache_relinquish_cookie(server->fscache, 0);
|
||||
server->fscache = NULL;
|
||||
}
|
||||
@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
|
||||
tcon->fscache =
|
||||
fscache_acquire_cookie(server->fscache,
|
||||
&cifs_fscache_super_index_def, tcon);
|
||||
cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache,
|
||||
tcon->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
|
||||
__func__, server->fscache, tcon->fscache);
|
||||
}
|
||||
|
||||
void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
|
||||
{
|
||||
cFYI(1, "%s: (0x%p)", __func__, tcon->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p)\n", __func__, tcon->fscache);
|
||||
fscache_relinquish_cookie(tcon->fscache, 0);
|
||||
tcon->fscache = NULL;
|
||||
}
|
||||
@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
|
||||
cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
|
||||
&cifs_fscache_inode_object_def, cifsi);
|
||||
cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__,
|
||||
tcon->fscache, cifsi->fscache);
|
||||
cifs_dbg(FYI, "%s: got FH cookie (0x%p/0x%p)\n",
|
||||
__func__, tcon->fscache, cifsi->fscache);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
|
||||
struct cifsInodeInfo *cifsi = CIFS_I(inode);
|
||||
|
||||
if (cifsi->fscache) {
|
||||
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
|
||||
fscache_relinquish_cookie(cifsi->fscache, 0);
|
||||
cifsi->fscache = NULL;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
|
||||
struct cifsInodeInfo *cifsi = CIFS_I(inode);
|
||||
|
||||
if (cifsi->fscache) {
|
||||
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
|
||||
fscache_uncache_all_inode_pages(cifsi->fscache, inode);
|
||||
fscache_relinquish_cookie(cifsi->fscache, 1);
|
||||
cifsi->fscache = NULL;
|
||||
@@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode)
|
||||
cifs_sb_master_tcon(cifs_sb)->fscache,
|
||||
&cifs_fscache_inode_object_def,
|
||||
cifsi);
|
||||
cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p",
|
||||
__func__, cifsi->fscache, old);
|
||||
cifs_dbg(FYI, "%s: new cookie 0x%p oldcookie 0x%p\n",
|
||||
__func__, cifsi->fscache, old);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
|
||||
struct inode *inode = page->mapping->host;
|
||||
struct cifsInodeInfo *cifsi = CIFS_I(inode);
|
||||
|
||||
cFYI(1, "%s: (0x%p/0x%p)", __func__, page,
|
||||
cifsi->fscache);
|
||||
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
|
||||
__func__, page, cifsi->fscache);
|
||||
if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
|
||||
return 0;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
|
||||
static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx,
|
||||
int error)
|
||||
{
|
||||
cFYI(1, "%s: (0x%p/%d)", __func__, page, error);
|
||||
cifs_dbg(FYI, "%s: (0x%p/%d)\n", __func__, page, error);
|
||||
if (!error)
|
||||
SetPageUptodate(page);
|
||||
unlock_page(page);
|
||||
@@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__,
|
||||
CIFS_I(inode)->fscache, page, inode);
|
||||
cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
|
||||
__func__, CIFS_I(inode)->fscache, page, inode);
|
||||
ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
|
||||
cifs_readpage_from_fscache_complete,
|
||||
NULL,
|
||||
@@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
|
||||
switch (ret) {
|
||||
|
||||
case 0: /* page found in fscache, read submitted */
|
||||
cFYI(1, "%s: submitted", __func__);
|
||||
cifs_dbg(FYI, "%s: submitted\n", __func__);
|
||||
return ret;
|
||||
case -ENOBUFS: /* page won't be cached */
|
||||
case -ENODATA: /* page not in cache */
|
||||
cFYI(1, "%s: %d", __func__, ret);
|
||||
cifs_dbg(FYI, "%s: %d\n", __func__, ret);
|
||||
return 1;
|
||||
|
||||
default:
|
||||
cERROR(1, "unknown error ret = %d", ret);
|
||||
cifs_dbg(VFS, "unknown error ret = %d\n", ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode,
|
||||
{
|
||||
int ret;
|
||||
|
||||
cFYI(1, "%s: (0x%p/%u/0x%p)", __func__,
|
||||
CIFS_I(inode)->fscache, *nr_pages, inode);
|
||||
cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n",
|
||||
__func__, CIFS_I(inode)->fscache, *nr_pages, inode);
|
||||
ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
|
||||
pages, nr_pages,
|
||||
cifs_readpage_from_fscache_complete,
|
||||
@@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode,
|
||||
mapping_gfp_mask(mapping));
|
||||
switch (ret) {
|
||||
case 0: /* read submitted to the cache for all pages */
|
||||
cFYI(1, "%s: submitted", __func__);
|
||||
cifs_dbg(FYI, "%s: submitted\n", __func__);
|
||||
return ret;
|
||||
|
||||
case -ENOBUFS: /* some pages are not cached and can't be */
|
||||
case -ENODATA: /* some pages are not cached */
|
||||
cFYI(1, "%s: no page", __func__);
|
||||
cifs_dbg(FYI, "%s: no page\n", __func__);
|
||||
return 1;
|
||||
|
||||
default:
|
||||
cFYI(1, "unknown error ret = %d", ret);
|
||||
cifs_dbg(FYI, "unknown error ret = %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__,
|
||||
CIFS_I(inode)->fscache, page, inode);
|
||||
cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n",
|
||||
__func__, CIFS_I(inode)->fscache, page, inode);
|
||||
ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
|
||||
if (ret != 0)
|
||||
fscache_uncache_page(CIFS_I(inode)->fscache, page);
|
||||
@@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
|
||||
struct cifsInodeInfo *cifsi = CIFS_I(inode);
|
||||
struct fscache_cookie *cookie = cifsi->fscache;
|
||||
|
||||
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie);
|
||||
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", __func__, page, cookie);
|
||||
fscache_wait_on_page_write(cookie, page);
|
||||
fscache_uncache_page(cookie, page);
|
||||
}
|
||||
|
||||
+57
-52
@@ -91,30 +91,32 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
|
||||
{
|
||||
struct cifsInodeInfo *cifs_i = CIFS_I(inode);
|
||||
|
||||
cFYI(1, "%s: revalidating inode %llu", __func__, cifs_i->uniqueid);
|
||||
cifs_dbg(FYI, "%s: revalidating inode %llu\n",
|
||||
__func__, cifs_i->uniqueid);
|
||||
|
||||
if (inode->i_state & I_NEW) {
|
||||
cFYI(1, "%s: inode %llu is new", __func__, cifs_i->uniqueid);
|
||||
cifs_dbg(FYI, "%s: inode %llu is new\n",
|
||||
__func__, cifs_i->uniqueid);
|
||||
return;
|
||||
}
|
||||
|
||||
/* don't bother with revalidation if we have an oplock */
|
||||
if (cifs_i->clientCanCacheRead) {
|
||||
cFYI(1, "%s: inode %llu is oplocked", __func__,
|
||||
cifs_i->uniqueid);
|
||||
cifs_dbg(FYI, "%s: inode %llu is oplocked\n",
|
||||
__func__, cifs_i->uniqueid);
|
||||
return;
|
||||
}
|
||||
|
||||
/* revalidate if mtime or size have changed */
|
||||
if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) &&
|
||||
cifs_i->server_eof == fattr->cf_eof) {
|
||||
cFYI(1, "%s: inode %llu is unchanged", __func__,
|
||||
cifs_i->uniqueid);
|
||||
cifs_dbg(FYI, "%s: inode %llu is unchanged\n",
|
||||
__func__, cifs_i->uniqueid);
|
||||
return;
|
||||
}
|
||||
|
||||
cFYI(1, "%s: invalidating inode %llu mapping", __func__,
|
||||
cifs_i->uniqueid);
|
||||
cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n",
|
||||
__func__, cifs_i->uniqueid);
|
||||
cifs_i->invalid_mapping = true;
|
||||
}
|
||||
|
||||
@@ -240,7 +242,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
|
||||
/* safest to call it a file if we do not know */
|
||||
fattr->cf_mode |= S_IFREG;
|
||||
fattr->cf_dtype = DT_REG;
|
||||
cFYI(1, "unknown type %d", le32_to_cpu(info->Type));
|
||||
cifs_dbg(FYI, "unknown type %d\n", le32_to_cpu(info->Type));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -279,7 +281,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
|
||||
{
|
||||
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
|
||||
|
||||
cFYI(1, "creating fake fattr for DFS referral");
|
||||
cifs_dbg(FYI, "creating fake fattr for DFS referral\n");
|
||||
|
||||
memset(fattr, 0, sizeof(*fattr));
|
||||
fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU;
|
||||
@@ -329,7 +331,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
|
||||
struct tcon_link *tlink;
|
||||
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
|
||||
|
||||
cFYI(1, "Getting info on %s", full_path);
|
||||
cifs_dbg(FYI, "Getting info on %s\n", full_path);
|
||||
|
||||
tlink = cifs_sb_tlink(cifs_sb);
|
||||
if (IS_ERR(tlink))
|
||||
@@ -355,7 +357,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
|
||||
int tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
|
||||
if (tmprc)
|
||||
cFYI(1, "CIFSCheckMFSymlink: %d", tmprc);
|
||||
cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
|
||||
}
|
||||
|
||||
if (*pinode == NULL) {
|
||||
@@ -422,7 +424,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
|
||||
&buf_type);
|
||||
if ((rc == 0) && (bytes_read >= 8)) {
|
||||
if (memcmp("IntxBLK", pbuf, 8) == 0) {
|
||||
cFYI(1, "Block device");
|
||||
cifs_dbg(FYI, "Block device\n");
|
||||
fattr->cf_mode |= S_IFBLK;
|
||||
fattr->cf_dtype = DT_BLK;
|
||||
if (bytes_read == 24) {
|
||||
@@ -434,7 +436,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
|
||||
fattr->cf_rdev = MKDEV(mjr, mnr);
|
||||
}
|
||||
} else if (memcmp("IntxCHR", pbuf, 8) == 0) {
|
||||
cFYI(1, "Char device");
|
||||
cifs_dbg(FYI, "Char device\n");
|
||||
fattr->cf_mode |= S_IFCHR;
|
||||
fattr->cf_dtype = DT_CHR;
|
||||
if (bytes_read == 24) {
|
||||
@@ -446,7 +448,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
|
||||
fattr->cf_rdev = MKDEV(mjr, mnr);
|
||||
}
|
||||
} else if (memcmp("IntxLNK", pbuf, 7) == 0) {
|
||||
cFYI(1, "Symlink");
|
||||
cifs_dbg(FYI, "Symlink\n");
|
||||
fattr->cf_mode |= S_IFLNK;
|
||||
fattr->cf_dtype = DT_LNK;
|
||||
} else {
|
||||
@@ -497,10 +499,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
|
||||
else if (rc > 3) {
|
||||
mode = le32_to_cpu(*((__le32 *)ea_value));
|
||||
fattr->cf_mode &= ~SFBITS_MASK;
|
||||
cFYI(1, "special bits 0%o org mode 0%o", mode,
|
||||
fattr->cf_mode);
|
||||
cifs_dbg(FYI, "special bits 0%o org mode 0%o\n",
|
||||
mode, fattr->cf_mode);
|
||||
fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode;
|
||||
cFYI(1, "special mode bits 0%o", mode);
|
||||
cifs_dbg(FYI, "special mode bits 0%o\n", mode);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -635,11 +637,11 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
tcon = tlink_tcon(tlink);
|
||||
server = tcon->ses->server;
|
||||
|
||||
cFYI(1, "Getting info on %s", full_path);
|
||||
cifs_dbg(FYI, "Getting info on %s\n", full_path);
|
||||
|
||||
if ((data == NULL) && (*inode != NULL)) {
|
||||
if (CIFS_I(*inode)->clientCanCacheRead) {
|
||||
cFYI(1, "No need to revalidate cached inode sizes");
|
||||
cifs_dbg(FYI, "No need to revalidate cached inode sizes\n");
|
||||
goto cgii_exit;
|
||||
}
|
||||
}
|
||||
@@ -714,7 +716,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
tcon, cifs_sb, full_path,
|
||||
&fattr.cf_uniqueid, data);
|
||||
if (tmprc) {
|
||||
cFYI(1, "GetSrvInodeNum rc %d", tmprc);
|
||||
cifs_dbg(FYI, "GetSrvInodeNum rc %d\n",
|
||||
tmprc);
|
||||
fattr.cf_uniqueid = iunique(sb, ROOT_I);
|
||||
cifs_autodisable_serverino(cifs_sb);
|
||||
}
|
||||
@@ -729,7 +732,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
|
||||
tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid);
|
||||
if (tmprc)
|
||||
cFYI(1, "cifs_sfu_type failed: %d", tmprc);
|
||||
cifs_dbg(FYI, "cifs_sfu_type failed: %d\n", tmprc);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIFS_ACL
|
||||
@@ -737,8 +740,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
|
||||
rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Getting ACL failed with error: %d",
|
||||
__func__, rc);
|
||||
cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n",
|
||||
__func__, rc);
|
||||
goto cgii_exit;
|
||||
}
|
||||
}
|
||||
@@ -752,7 +755,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
|
||||
tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
|
||||
if (tmprc)
|
||||
cFYI(1, "CIFSCheckMFSymlink: %d", tmprc);
|
||||
cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
|
||||
}
|
||||
|
||||
if (!*inode) {
|
||||
@@ -836,7 +839,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
|
||||
struct inode *inode;
|
||||
|
||||
retry_iget5_locked:
|
||||
cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid);
|
||||
cifs_dbg(FYI, "looking for uniqueid=%llu\n", fattr->cf_uniqueid);
|
||||
|
||||
/* hash down to 32-bits on 32-bit arch */
|
||||
hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
|
||||
@@ -899,7 +902,7 @@ struct inode *cifs_root_iget(struct super_block *sb)
|
||||
#endif
|
||||
|
||||
if (rc && tcon->ipc) {
|
||||
cFYI(1, "ipc connection - fake read inode");
|
||||
cifs_dbg(FYI, "ipc connection - fake read inode\n");
|
||||
spin_lock(&inode->i_lock);
|
||||
inode->i_mode |= S_IFDIR;
|
||||
set_nlink(inode, 2);
|
||||
@@ -958,7 +961,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
|
||||
* server times.
|
||||
*/
|
||||
if (set_time && (attrs->ia_valid & ATTR_CTIME)) {
|
||||
cFYI(1, "CIFS - CTIME changed");
|
||||
cifs_dbg(FYI, "CIFS - CTIME changed\n");
|
||||
info_buf.ChangeTime =
|
||||
cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime));
|
||||
} else
|
||||
@@ -1127,7 +1130,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
struct iattr *attrs = NULL;
|
||||
__u32 dosattr = 0, origattr = 0;
|
||||
|
||||
cFYI(1, "cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry);
|
||||
cifs_dbg(FYI, "cifs_unlink, dir=0x%p, dentry=0x%p\n", dir, dentry);
|
||||
|
||||
tlink = cifs_sb_tlink(cifs_sb);
|
||||
if (IS_ERR(tlink))
|
||||
@@ -1150,7 +1153,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
rc = CIFSPOSIXDelFile(xid, tcon, full_path,
|
||||
SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
|
||||
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
||||
cFYI(1, "posix del rc %d", rc);
|
||||
cifs_dbg(FYI, "posix del rc %d\n", rc);
|
||||
if ((rc == 0) || (rc == -ENOENT))
|
||||
goto psx_del_no_retry;
|
||||
}
|
||||
@@ -1320,7 +1323,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
|
||||
if (rc == -EOPNOTSUPP)
|
||||
goto posix_mkdir_out;
|
||||
else if (rc) {
|
||||
cFYI(1, "posix mkdir returned 0x%x", rc);
|
||||
cifs_dbg(FYI, "posix mkdir returned 0x%x\n", rc);
|
||||
d_drop(dentry);
|
||||
goto posix_mkdir_out;
|
||||
}
|
||||
@@ -1342,11 +1345,12 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
|
||||
d_instantiate(dentry, newinode);
|
||||
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
cFYI(1, "instantiated dentry %p %s to inode %p", dentry,
|
||||
dentry->d_name.name, newinode);
|
||||
cifs_dbg(FYI, "instantiated dentry %p %s to inode %p\n",
|
||||
dentry, dentry->d_name.name, newinode);
|
||||
|
||||
if (newinode->i_nlink != 2)
|
||||
cFYI(1, "unexpected number of links %d", newinode->i_nlink);
|
||||
cifs_dbg(FYI, "unexpected number of links %d\n",
|
||||
newinode->i_nlink);
|
||||
#endif
|
||||
|
||||
posix_mkdir_out:
|
||||
@@ -1368,7 +1372,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
|
||||
struct TCP_Server_Info *server;
|
||||
char *full_path;
|
||||
|
||||
cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode);
|
||||
cifs_dbg(FYI, "In cifs_mkdir, mode = 0x%hx inode = 0x%p\n",
|
||||
mode, inode);
|
||||
|
||||
cifs_sb = CIFS_SB(inode->i_sb);
|
||||
tlink = cifs_sb_tlink(cifs_sb);
|
||||
@@ -1402,7 +1407,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
|
||||
/* BB add setting the equivalent of mode via CreateX w/ACLs */
|
||||
rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb);
|
||||
if (rc) {
|
||||
cFYI(1, "cifs_mkdir returned 0x%x", rc);
|
||||
cifs_dbg(FYI, "cifs_mkdir returned 0x%x\n", rc);
|
||||
d_drop(direntry);
|
||||
goto mkdir_out;
|
||||
}
|
||||
@@ -1432,7 +1437,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
|
||||
char *full_path = NULL;
|
||||
struct cifsInodeInfo *cifsInode;
|
||||
|
||||
cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
|
||||
cifs_dbg(FYI, "cifs_rmdir, inode = 0x%p\n", inode);
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
@@ -1681,8 +1686,8 @@ cifs_invalidate_mapping(struct inode *inode)
|
||||
if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
|
||||
rc = invalidate_inode_pages2(inode->i_mapping);
|
||||
if (rc) {
|
||||
cERROR(1, "%s: could not invalidate inode %p", __func__,
|
||||
inode);
|
||||
cifs_dbg(VFS, "%s: could not invalidate inode %p\n",
|
||||
__func__, inode);
|
||||
cifs_i->invalid_mapping = true;
|
||||
}
|
||||
}
|
||||
@@ -1732,8 +1737,8 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
|
||||
goto out;
|
||||
}
|
||||
|
||||
cFYI(1, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time "
|
||||
"%ld jiffies %ld", full_path, inode, inode->i_count.counter,
|
||||
cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n",
|
||||
full_path, inode, inode->i_count.counter,
|
||||
dentry, dentry->d_time, jiffies);
|
||||
|
||||
if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext)
|
||||
@@ -1883,7 +1888,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
||||
else
|
||||
rc = -ENOSYS;
|
||||
cifsFileInfo_put(open_file);
|
||||
cFYI(1, "SetFSize for attrs rc = %d", rc);
|
||||
cifs_dbg(FYI, "SetFSize for attrs rc = %d\n", rc);
|
||||
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
|
||||
unsigned int bytes_written;
|
||||
|
||||
@@ -1894,7 +1899,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
||||
io_parms.length = attrs->ia_size;
|
||||
rc = CIFSSMBWrite(xid, &io_parms, &bytes_written,
|
||||
NULL, NULL, 1);
|
||||
cFYI(1, "Wrt seteof rc %d", rc);
|
||||
cifs_dbg(FYI, "Wrt seteof rc %d\n", rc);
|
||||
}
|
||||
} else
|
||||
rc = -EINVAL;
|
||||
@@ -1920,7 +1925,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
||||
attrs->ia_size, cifs_sb, false);
|
||||
else
|
||||
rc = -ENOSYS;
|
||||
cFYI(1, "SetEOF by path (setattrs) rc = %d", rc);
|
||||
cifs_dbg(FYI, "SetEOF by path (setattrs) rc = %d\n", rc);
|
||||
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
|
||||
__u16 netfid;
|
||||
int oplock = 0;
|
||||
@@ -1940,7 +1945,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
||||
io_parms.length = attrs->ia_size;
|
||||
rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL,
|
||||
NULL, 1);
|
||||
cFYI(1, "wrt seteof rc %d", rc);
|
||||
cifs_dbg(FYI, "wrt seteof rc %d\n", rc);
|
||||
CIFSSMBClose(xid, tcon, netfid);
|
||||
}
|
||||
}
|
||||
@@ -1971,7 +1976,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
|
||||
struct cifs_unix_set_info_args *args = NULL;
|
||||
struct cifsFileInfo *open_file;
|
||||
|
||||
cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
|
||||
cifs_dbg(FYI, "setattr_unix on file %s attrs->ia_valid=0x%x\n",
|
||||
direntry->d_name.name, attrs->ia_valid);
|
||||
|
||||
xid = get_xid();
|
||||
@@ -2114,7 +2119,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
|
||||
cifs_dbg(FYI, "setattr on file %s attrs->iavalid 0x%x\n",
|
||||
direntry->d_name.name, attrs->ia_valid);
|
||||
|
||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
|
||||
@@ -2166,8 +2171,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
|
||||
rc = id_mode_to_cifs_acl(inode, full_path, NO_CHANGE_64,
|
||||
uid, gid);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Setting id failed with error: %d",
|
||||
__func__, rc);
|
||||
cifs_dbg(FYI, "%s: Setting id failed with error: %d\n",
|
||||
__func__, rc);
|
||||
goto cifs_setattr_exit;
|
||||
}
|
||||
}
|
||||
@@ -2188,8 +2193,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
|
||||
rc = id_mode_to_cifs_acl(inode, full_path, mode,
|
||||
INVALID_UID, INVALID_GID);
|
||||
if (rc) {
|
||||
cFYI(1, "%s: Setting ACL failed with error: %d",
|
||||
__func__, rc);
|
||||
cifs_dbg(FYI, "%s: Setting ACL failed with error: %d\n",
|
||||
__func__, rc);
|
||||
goto cifs_setattr_exit;
|
||||
}
|
||||
} else
|
||||
@@ -2277,7 +2282,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
|
||||
#if 0
|
||||
void cifs_delete_inode(struct inode *inode)
|
||||
{
|
||||
cFYI(1, "In cifs_delete_inode, inode = 0x%p", inode);
|
||||
cifs_dbg(FYI, "In cifs_delete_inode, inode = 0x%p\n", inode);
|
||||
/* may have to add back in if and when safe distributed caching of
|
||||
directories added e.g. via FindNotify */
|
||||
}
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg);
|
||||
cifs_dbg(FYI, "ioctl file %p cmd %u arg %lu\n", filep, command, arg);
|
||||
|
||||
cifs_sb = CIFS_SB(inode->i_sb);
|
||||
|
||||
@@ -83,11 +83,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
|
||||
* &ExtAttrMask);
|
||||
*/
|
||||
}
|
||||
cFYI(1, "set flags not implemented yet");
|
||||
cifs_dbg(FYI, "set flags not implemented yet\n");
|
||||
break;
|
||||
#endif /* CONFIG_CIFS_POSIX */
|
||||
default:
|
||||
cFYI(1, "unsupported ioctl");
|
||||
cifs_dbg(FYI, "unsupported ioctl\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user