14 Nov, 2018
1 commit
-
commit 2c887635cd6ab3af619dc2be94e5bf8f2e172b78 upstream.
Currently, "echo 0 > /proc/fs/cifs/Stats" resets all of the stats
except the session and share reconnect counts. Fix it to
reset those as well.CC: Stable
Signed-off-by: Steve French
Reviewed-by: Aurelien Aptel
Signed-off-by: Greg Kroah-Hartman
15 Sep, 2018
1 commit
-
[ Upstream commit c281bc0c7412308c7ec0888904f7c99353da4796 ]
echo 0 > /proc/fs/cifs/Stats is supposed to reset the stats
but there were four (see example below) that were not reset
(bytes read and witten, total vfs ops and max ops
at one time)....
0 session 0 share reconnects
Total vfs operations: 100 maximum at one time: 21) \\localhost\test
SMBs: 0
Bytes read: 502092 Bytes written: 31457286
TreeConnects: 0 total 0 failed
TreeDisconnects: 0 total 0 failed
...This patch fixes cifs_stats_proc_write to properly reset
those four.Signed-off-by: Steve French
Reviewed-by: Aurelien Aptel
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
05 Sep, 2018
1 commit
-
commit 950132afd59385caf6e2b84e5235d069fa10681d upstream.
/proc/fs/cifs/DebugData displays the features (Kconfig options)
used to build cifs.ko but it was missing some, and needed comma
separator. These can be useful in debugging certain problems
so we know which optional features were enabled in the user's build.
Also clarify them, by making them more closely match the
corresponding CONFIG_CIFS_* parm.Old format:
Features: dfs fscache posix spnego xattr aclNew format:
Features: DFS,FSCACHE,SMB_DIRECT,STATS,DEBUG2,ALLOW_INSECURE_LEGACY,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACLSigned-off-by: Steve French
Reviewed-by: Ronnie Sahlberg
Reviewed-by: Pavel Shilovsky
Reviewed-by: Paulo Alcantara
CC: Stable
Signed-off-by: Greg Kroah-Hartman
21 Sep, 2017
1 commit
-
We were not displaying some key fields (session status and capabilities and
whether guest authenticated) for SMB2/SMB3 session in /proc/fs/cifs/DebugData.This is needed for real world triage of problems with the (now much more
common) SMB3 mounts.Signed-off-by: Steve French
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
13 Oct, 2016
1 commit
-
In debugging smb3, it is useful to display the number
of credits available, so we can see when the server has not granted
sufficient operations for the client to make progress, or alternatively
the client has requested too many credits (as we saw in a recent bug)
so we can compare with the number of credits the server thinks
we have.Add a /proc/fs/cifs/DebugData line to display the client view
on how many credits are available.Signed-off-by: Steve French
Reported-by: Germano Percossi
CC: Stable
30 May, 2016
1 commit
-
it's not needed for file_operations of inodes located on fs defined
in the hosting module and for file_operations that go into procfs.Signed-off-by: Al Viro
18 Mar, 2016
1 commit
-
Some callers of strtobool() were passing a pointer to unterminated
strings. In preparation of adding multi-character processing to
kstrtobool(), update the callers to not pass single-character pointers,
and switch to using the new kstrtobool_from_user() helper where
possible.Signed-off-by: Kees Cook
Cc: Amitkumar Karwar
Cc: Nishant Sarmukadam
Cc: Kalle Valo
Cc: Steve French
Cc: Andy Shevchenko
Cc: Daniel Borkmann
Cc: Heiko Carstens
Cc: Joe Perches
Cc: Kees Cook
Cc: Martin Schwidefsky
Cc: Michael Ellerman
Cc: Rasmus Villemoes
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Jan, 2016
1 commit
-
Under some conditions, CIFS can repeatedly call the cifs_dbg() logging
wrapper. If done rapidly enough, the console framebuffer can softlockup
or "rcu_sched self-detected stall". Apply the built-in log ratelimiters
to prevent such hangs.Signed-off-by: Jamie Bainbridge
Signed-off-by: Steve French
CC: Stable
27 Jan, 2015
1 commit
-
If CONFIG_CIFS_WEAK_PW_HASH is not set, CIFSSEC_MUST_LANMAN
and CIFSSEC_MUST_PLNTXT is defined as 0.When setting new SecurityFlags without any MUST flags,
your flags would be overwritten with CIFSSEC_MUST_LANMAN (0).Signed-off-by: Niklas Cassel
Signed-off-by: Steve French
08 Dec, 2014
3 commits
-
The useful macros embed message level in the name. Thus, it cleans up the code
a bit. In cases when it was plain printk() the conversion was done to info
level.Signed-off-by: Andy Shevchenko
Signed-off-by: Steve French -
This patch converts custom dumper to use native print_hex_dump() instead. The
cifs_dump_mem() will have an offsets per each line which differs it from the
original code.In the dump_smb() we may use native print_hex_dump() as well. It will show
slightly different output in ASCII part when character is unprintable,
otherwise it keeps same structure.Signed-off-by: Andy Shevchenko
Signed-off-by: Steve French -
Meanwhile it cleans up the code, the behaviour is slightly changed. In case of
providing non-boolean value it will fails with corresponding error. In the
original code the attempt of an update was just ignored in such case.Signed-off-by: Andy Shevchenko
Acked-by: Jeff Layton
Reviewed-by: Alexander Bokovoy
Signed-off-by: Steve French
03 Aug, 2014
1 commit
-
Joe Perches and Hans Wennborg noticed that various places in the
kernel were printing decimal numbers with 0x prefix.
printk("0x%d") or equivalent
This fixes the instances of this in the cifs driver.CC: Hans Wennborg
CC: Joe Perches
Signed-off-by: Steve French
27 Jun, 2013
1 commit
-
The cifs.ko SecurityFlags interface wins my award for worst-designed
interface ever, but we're sort of stuck with it since it's documented
and people do use it (even if it doesn't work correctly).Case in point -- you can specify multiple sets of "MUST" flags. It makes
absolutely no sense, but you can do it.What should the effect be in such a case? No one knows or seems to have
considered this so far, so let's define it now. If you try to specify
multiple MUST flags, clear any other MAY or MUST bits except for the
ones that involve signing.Signed-off-by: Jeff Layton
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French
24 Jun, 2013
2 commits
-
SMB3 protocol adds various optional per-share capabilities (and
SMB3.02 adds one more beyond that). Add ability to dump
(/proc/fs/cifs/DebugData) the share capabilities and share flags to
improve debugging.Signed-off-by: Steve French
Acked-by: Jeff Layton -
The SecurityFlags handler uses an obsolete simple_strtoul() call, and
doesn't really handle the bounds checking well. Fix it to use
kstrtouint() instead. Clean up the error messages as well and fix a
bogus check for an unsigned int to be less than 0.Signed-off-by: Jeff Layton
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French
05 May, 2013
1 commit
-
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.oldOther 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 macroSigned-off-by: Joe Perches
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
25 Jul, 2012
2 commits
-
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Now we can process SMB2 messages: check message, get message id
and wakeup awaiting routines.Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
23 May, 2012
1 commit
-
Acked-by: Shirish Pargaonkar
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
17 May, 2012
1 commit
-
We've now warned about this for two releases. Remove it for 3.5.
Signed-off-by: Jeff Layton
24 Mar, 2012
3 commits
-
We've had a deprecation warning on this file for 2 releases now. Remove
it as promised for 3.4.Signed-off-by: Jeff Layton
-
to be protocol-unspecific and big enough to keep both CIFS
and SMB2 values.Signed-off-by: Pavel Shilovsky
-
Signed-off-by: Pavel Shilovsky
22 Mar, 2012
1 commit
-
by making it as unsigned integer and surround access with req_lock
from server structure.Reviewed-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
18 Jan, 2012
1 commit
-
We'll allow a grace period of 2 releases (3.3 and 3.4) and then remove
the legacy code in 3.5.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
13 Oct, 2011
2 commits
-
The plan is to deprecate this interface by kernel version 3.4.
Changes since v1
- add a '\n' to the printk.Reported-by: Alexander Swen
Cc: Jeff Layton
Signed-off-by: Suresh Jayaraman
Signed-off-by: Steve French -
Thus spake Jeff Layton:
"Making that a module parm would allow you to set that parameter at boot
time without needing to add special startup scripts. IMO, all of the
procfile "switches" under /proc/fs/cifs should be module parms
instead."This patch doesn't alter the default behavior (Oplocks are enabled by
default).To disable oplocks when loading the module, use
modprobe cifs enable_oplocks=0
(any of '0' or 'n' or 'N' conventions can be used).
To disable oplocks at runtime using the new interface, use
echo 0 > /sys/module/cifs/parameters/enable_oplocks
The older /proc/fs/cifs/OplockEnabled interface will be deprecated
after two releases. A subsequent patch will add an warning message
about this deprecation.Changes since v2:
- make enable_oplocks a 'bool'Changes since v1:
- eliminate the use of extra variable by renaming the old one to
enable_oplocks and make it an 'int' type.Reported-by: Alexander Swen
Reviewed-by: Jeff Layton
Signed-off-by: Suresh Jayaraman
Signed-off-by: Steve French
12 Aug, 2011
1 commit
-
Christoph had requested that the stats related code (in
CONFIG_CIFS_STATS2) be moved into helpers to make code flow more
readable. This patch should help. For example the following
section from transport.cspin_unlock(&GlobalMid_Lock);
atomic_inc(&ses->server->num_waiters);
wait_event(ses->server->request_q,
atomic_read(&ses->server->inFlight)
< cifs_max_pending);
atomic_dec(&ses->server->num_waiters);
spin_lock(&GlobalMid_Lock);becomes simpler (with the patch below):
spin_unlock(&GlobalMid_Lock);
cifs_num_waiters_inc(server);
wait_event(server->request_q,
atomic_read(&server->inFlight)
< cifs_max_pending);
cifs_num_waiters_dec(server);
spin_lock(&GlobalMid_Lock);Reviewed-by: Jeff Layton
CC: Christoph Hellwig
Signed-off-by: Steve French
Reviewed-by: Pavel Shilovsky
27 May, 2011
1 commit
-
secMode to sec_mode
and
cifsTconInfo to cifs_tcon
and
cifsSesInfo to cifs_sesSigned-off-by: Steve French
19 May, 2011
1 commit
-
This is the same patch as originally posted, just with some merge
conflicts fixed up...Currently, the ByteCount is usually converted to host-endian on receive.
This is confusing however, as we need to keep two sets of routines for
accessing it, and keep track of when to use each routine. Munging
received packets like this also limits when the signature can be
calulated.Simplify the code by keeping the received ByteCount in little-endian
format. This allows us to eliminate a set of routines for accessing it
and we can now drop the *_le suffixes from the accessor functions since
that's now implied.While we're at it, switch all of the places that read the ByteCount
directly to use the get_bcc inline which should also clean up some
unaligned accesses.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
12 Apr, 2011
1 commit
-
This flag currently only affects whether we allow "zero-copy" writes
with signing enabled. Typically we map pages in the pagecache directly
into the write request. If signing is enabled however and the contents
of the page change after the signature is calculated but before the
write is sent then the signature will be wrong. Servers typically
respond to this by closing down the socket.Still, this can provide a performance benefit so the "Experimental" flag
was overloaded to allow this. That's really not a good place for this
option however since it's not clear what that flag does.Move that flag instead to a new module parameter that better describes
its purpose. That's also better since it can be set at module insertion
time by configuring modprobe.d.Reviewed-by: Suresh Jayaraman
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
21 Jan, 2011
1 commit
-
In order to incorporate async requests, we need to allow for a more
general way to do things on receive, rather than just waking up a
process.Turn the task pointer in the mid_q_entry into a callback function and a
generic data pointer. When a response comes in, or the socket is
reconnected, cifsd can call the callback function in order to wake up
the process.The default is to just wake up the current process which should mean no
change in behavior for existing code.Also, clean up the locking in cifs_reconnect. There doesn't seem to be
any need to hold both the srv_mutex and GlobalMid_Lock when walking the
list of mids.Reviewed-by: Suresh Jayaraman
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
20 Jan, 2011
1 commit
-
It's an atomic_t and the code accesses the "counter" field in it directly
instead of using atomic_read(). It also is sometimes accessed under a
spinlock and sometimes not. Move it out of the spinlock since we don't need
belt-and-suspenders for something that's just informational.Reviewed-by: Suresh Jayaraman
Reviewed-by: Pavel Shilovsky
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
10 Jan, 2011
1 commit
-
...and while we're at it, reduce the number of calls into the seq_*
functions by prepending spaces to strings.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
21 Oct, 2010
1 commit
-
cifs_tcp_ses_lock is a rwlock with protects the cifs_tcp_ses_list,
server->smb_ses_list and the ses->tcon_list. It also protects a few
ref counters in server, ses and tcon. In most cases the critical section
doesn't seem to be large, in a few cases where it is slightly large, there
seem to be really no benefit from concurrent access. I briefly considered RCU
mechanism but it appears to me that there is no real need.Replace it with a spinlock and get rid of the last rwlock in the cifs code.
Signed-off-by: Suresh Jayaraman
Signed-off-by: Steve French
06 Aug, 2010
1 commit
-
Fixed the nit pointed out by Jeff.
From: Suresh Jayaraman
Subject: [PATCH 1/2] cifs: show features compiled in as part of DebugDataThis patch adds the features that are compiled in to the CIFS debugging data
as shown below:$cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.64
Features: dfs fscache posix spnego xattr
Active VFS Requests: 0
...This patch provides a definitive way to tell what features are currently
enabled in the running kernel. This could also help debugging.Signed-off-by: Suresh Jayaraman
Cc: Jeff Layton
Signed-off-by: Steve French
27 Apr, 2010
1 commit
-
...since that more accurately describes what that variable holds.
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
21 Apr, 2010
1 commit
-
Neaten cERROR and cFYI macros, reduce text space
~2.5KConvert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
Surround macros with do {} while
Add parentheses to macros
Make statement expression macro from macro with assign
Remove now unnecessary parentheses from cFYI and cERROR usesdefconfig with CIFS support old
$ size fs/cifs/built-in.o
text data bss dec hex filename
156012 1760 148 157920 268e0 fs/cifs/built-in.odefconfig with CIFS support old
$ size fs/cifs/built-in.o
text data bss dec hex filename
153508 1760 148 155416 25f18 fs/cifs/built-in.oallyesconfig old:
$ size fs/cifs/built-in.o
text data bss dec hex filename
309138 3864 74824 387826 5eaf2 fs/cifs/built-in.oallyesconfig new
$ size fs/cifs/built-in.o
text data bss dec hex filename
305655 3864 74824 384343 5dd57 fs/cifs/built-in.oSigned-off-by: Joe Perches
Signed-off-by: Steve French