<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs/misc.c, branch linux-3.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-05-31T20:20:29Z</updated>
<entry>
<title>cifs: Wait for writebacks to complete before attempting write.</title>
<updated>2014-05-31T20:20:29Z</updated>
<author>
<name>Sachin Prabhu</name>
</author>
<published>2014-03-11T16:11:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aedc82aa4086dd2a7b83bbe1e123bb340c8aa406'/>
<id>urn:sha1:aedc82aa4086dd2a7b83bbe1e123bb340c8aa406</id>
<content type='text'>
commit c11f1df5003d534fd067f0168bfad7befffb3b5c upstream.

Problem reported in Red Hat bz 1040329 for strict writes where we cache
only when we hold oplock and write direct to the server when we don't.

When we receive an oplock break, we first change the oplock value for
the inode in cifsInodeInfo-&gt;oplock to indicate that we no longer hold
the oplock before we enqueue a task to flush changes to the backing
device. Once we have completed flushing the changes, we return the
oplock to the server.

There are 2 ways here where we can have data corruption
1) While we flush changes to the backing device as part of the oplock
break, we can have processes write to the file. These writes check for
the oplock, find none and attempt to write directly to the server.
These direct writes made while we are flushing from cache could be
overwritten by data being flushed from the cache causing data
corruption.
2) While a thread runs in cifs_strict_writev, the machine could receive
and process an oplock break after the thread has checked the oplock and
found that it allows us to cache and before we have made changes to the
cache. In that case, we end up with a dirty page in cache when we
shouldn't have any. This will be flushed later and will overwrite all
subsequent writes to the part of the file represented by this page.

Before making any writes to the server, we need to confirm that we are
not in the process of flushing data to the server and if we are, we
should wait until the process is complete before we attempt the write.
We should also wait for existing writes to complete before we process
an oplock break request which changes oplock values.

We add a version specific  downgrade_oplock() operation to allow for
differences in the oplock values set for the different smb versions.

Signed-off-by: Sachin Prabhu &lt;sprabhu@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs: Make big endian multiplex ID sequences monotonic on the wire</title>
<updated>2013-11-02T17:51:53Z</updated>
<author>
<name>Tim Gardner</name>
</author>
<published>2013-11-02T17:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d378d3fd82a759d59c60d89b4559bf325d7e668'/>
<id>urn:sha1:3d378d3fd82a759d59c60d89b4559bf325d7e668</id>
<content type='text'>
The multiplex identifier (MID) in the SMB header is only
ever used by the client, in conjunction with PID, to match responses
from the server. As such, the endianess of the MID is not important.
However, When tracing packet sequences on the wire, protocol analyzers
such as wireshark display MID as little endian. It is much more informative
for the on-the-wire MID sequences to match debug information emitted by the
CIFS driver.  Therefore, one should write and read MID in the SMB header
assuming it is always little endian.

Observed from wireshark during the protocol negotiation
and session setup:

        Multiplex ID: 256
        Multiplex ID: 256
        Multiplex ID: 512
        Multiplex ID: 512
        Multiplex ID: 768
        Multiplex ID: 768

After this patch on-the-wire MID values begin at 1 and increase monotonically.

Introduce get_next_mid64() for the internal consumers that use the full 64 bit
multiplex identifier.

Introduce the helpers get_mid() and compare_mid() to make the endian
translation clear.

Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Tim Gardner &lt;timg@tpi.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Remove redundant multiplex identifier check from check_smb_hdr()</title>
<updated>2013-10-28T14:31:36Z</updated>
<author>
<name>Tim Gardner</name>
</author>
<published>2013-10-16T15:09:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=944d6f1a5b8f42a780a65378e5f52bea3ae0ce07'/>
<id>urn:sha1:944d6f1a5b8f42a780a65378e5f52bea3ae0ce07</id>
<content type='text'>
The only call site for check_smb_header() assigns 'mid' from the SMB
packet, which is then checked again in check_smb_header(). This seems
like redundant redundancy.

Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Tim Gardner &lt;timg@tpi.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Replace clientCanCache* bools with an integer</title>
<updated>2013-09-08T22:49:17Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2013-09-05T09:01:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18cceb6a78f46b65df654e8348fa2093b91b30f6'/>
<id>urn:sha1:18cceb6a78f46b65df654e8348fa2093b91b30f6</id>
<content type='text'>
that prepare the code to handle different types of SMB2 leases.

Signed-off-by: Pavel Shilovsky &lt;pshilovsky@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Process post session setup code in respective dialect functions.</title>
<updated>2013-09-08T19:47:47Z</updated>
<author>
<name>Shirish Pargaonkar</name>
</author>
<published>2013-08-29T13:35:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4e63bd6e40da30e965e8947b98ba75c6b973c62'/>
<id>urn:sha1:d4e63bd6e40da30e965e8947b98ba75c6b973c62</id>
<content type='text'>
Move the post (successful) session setup code to respective dialect routines.

For smb1, session key is per smb connection.
For smb2/smb3, session key is per smb session.

If client and server do not require signing, free session key for smb1/2/3.

If client and server require signing
  smb1 - Copy (kmemdup) session key for the first session to connection.
         Free session key of that and subsequent sessions on this connection.
  smb2 - For every session, keep the session key and free it when the
         session is being shutdown.
  smb3 - For every session, generate the smb3 signing key using the session key
         and then free the session key.

There are two unrelated line formatting changes as well.

Reviewed-by: Jeff Layton &lt;jlayton@samba.org&gt;
Signed-off-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: track the enablement of signing in the TCP_Server_Info</title>
<updated>2013-06-24T06:56:43Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2013-05-26T11:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38d77c50b4f4e3ea1687e119871364f1c8d2f531'/>
<id>urn:sha1:38d77c50b4f4e3ea1687e119871364f1c8d2f531</id>
<content type='text'>
Currently, we determine this according to flags in the sec_mode, flags
in the global_secflags and via other methods. That makes the semantics
very hard to follow and there are corner cases where we don't handle
this correctly.

Add a new bool to the TCP_Server_Info that acts as a simple flag to tell
us whether signing is enabled on this connection or not, and fix up the
places that need to determine this to use that flag.

This is a bit weird for the SMB2 case, where signing is per-session.
SMB2 needs work in this area already though. The existing SMB2 code has
similar logic to what we're using here, so there should be no real
change in behavior. These changes should make it easier to implement
per-session signing in the future though.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg</title>
<updated>2013-05-05T03:17:23Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2013-05-05T03:12:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f96637be081141d6f8813429499f164260b49d70'/>
<id>urn:sha1:f96637be081141d6f8813429499f164260b49d70</id>
<content type='text'>
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, ...)   -&gt; cifs_dbg(VFS, ...)
	cFYI(1, ...)     -&gt; cifs_dbg(FYI, ...)
	cFYI(DBG2, ...)  -&gt; 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 &lt;joe@perches.com&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Convert struct cifs_sb_info to use kuids and kgids</title>
<updated>2013-02-13T15:28:54Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2013-02-06T09:20:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f68233c52e9f2bb53130a0063bc1e6864f6d204'/>
<id>urn:sha1:1f68233c52e9f2bb53130a0063bc1e6864f6d204</id>
<content type='text'>
Cc: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Fix fast lease break after open problem</title>
<updated>2012-09-25T02:46:33Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2012-09-19T13:22:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=233839b1df65a24c8b67b748fe7b18d86d0ad6d7'/>
<id>urn:sha1:233839b1df65a24c8b67b748fe7b18d86d0ad6d7</id>
<content type='text'>
Now we walk though cifsFileInfo's list for every incoming lease
break and look for an equivalent there. That approach misses lease
breaks that come just after an open response - we don't have time
to populate new cifsFileInfo structure to the list. Fix this by
adding new list of pending opens and look for a lease there if we
didn't find it in the list of cifsFileInfo structures.

Signed-off-by: Pavel Shilovsky &lt;pshilovsky@etersoft.ru&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Replace netfid with cifs_fid struct in cifsFileInfo</title>
<updated>2012-09-25T02:46:26Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2012-09-18T23:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b4de76e35518fc0c636f628abca8c1b19ad6689'/>
<id>urn:sha1:4b4de76e35518fc0c636f628abca8c1b19ad6689</id>
<content type='text'>
This is help us to extend the code for future protocols that can use
another fid mechanism (as SMB2 that has it divided into two parts:
persistent and violatile).

Also rename variables and refactor the code around the changes.

Reviewed-by: Jeff Layton &lt;jlayton@samba.org&gt;
Signed-off-by: Pavel Shilovsky &lt;pshilovsky@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
</feed>
