16 Sep, 2016
1 commit
-
Use d_fsdata instead, which is the same size. Introduce helpers to hide
the typecasts.Signed-off-by: Miklos Szeredi
Cc: Steve French
01 Aug, 2016
1 commit
-
Signed-off-by: Al Viro
30 Jul, 2016
2 commits
-
dentry->d_sb is just as good as parent->d_sb
Signed-off-by: Al Viro
-
Pull CIFS/SMB3 fixes from Steve French:
"Various CIFS/SMB3 fixes, most for stable"* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
CIFS: Fix a possible invalid memory access in smb2_query_symlink()
fs/cifs: make share unaccessible at root level mountable
cifs: fix crash due to race in hmac(md5) handling
cifs: unbreak TCP session reuse
cifs: Check for existing directory when opening file with O_CREAT
Add MF-Symlinks support for SMB 2.0
29 Jul, 2016
1 commit
-
This changes the vfs dentry hashing to mix in the parent pointer at the
_beginning_ of the hash, rather than at the end.That actually improves both the hash and the code generation, because we
can move more of the computation to the "static" part of the dcache
setup, and do less at lookup runtime.It turns out that a lot of other hash users also really wanted to mix in
a base pointer as a 'salt' for the hash, and so the slightly extended
interface ends up working well for other cases too.Users that want a string hash that is purely about the string pass in a
'salt' pointer of NULL.* merge branch 'salted-string-hash':
fs/dcache.c: Save one 32-bit multiply in dcache lookup
vfs: make the string hashes salt the hash
28 Jul, 2016
1 commit
-
if, when mounting //HOST/share/sub/dir/foo we can query /sub/dir/foo but
not any of the path components above:- store the /sub/dir/foo prefix in the cifs super_block info
- in the superblock, set root dentry to the subpath dentry (instead of
the share root)
- set a flag in the superblock to remember it
- use prefixpath when building path from a dentryfixes bso#8950
Signed-off-by: Aurelien Aptel
CC: Stable
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French
13 Jul, 2016
1 commit
-
When opening a file with O_CREAT flag, check to see if the file opened
is an existing directory.This prevents the directory from being opened which subsequently causes
a crash when the close function for directories cifs_closedir() is called
which frees up the file->private_data memory while the file is still
listed on the open file list for the tcon.Signed-off-by: Sachin Prabhu
Signed-off-by: Steve French
CC: Stable
Reported-by: Xiaoli Feng
06 Jul, 2016
1 commit
-
->atomic_open() can be given an in-lookup dentry *or* a negative one
found in dcache. Use d_in_lookup() to tell one from another, rather
than d_unhashed().Signed-off-by: Al Viro
11 Jun, 2016
1 commit
-
We always mixed in the parent pointer into the dentry name hash, but we
did it late at lookup time. It turns out that we can simplify that
lookup-time action by salting the hash with the parent pointer early
instead of late.A few other users of our string hashes also wanted to mix in their own
pointers into the hash, and those are updated to use the same mechanism.Hash users that don't have any particular initial salt can just use the
NULL pointer as a no-salt.Cc: Vegard Nossum
Cc: George Spelvin
Cc: Al Viro
Signed-off-by: Linus Torvalds
11 May, 2015
1 commit
-
Cifs client has problem with reserved chars filename.
[BUG1] : several functions handle incorrect value of mapchars
- cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
+ cifs_remap(cifs_sb));[BUG2] : forget to convert reserved chars when creating SymbolicLink.
- CIFSUnixCreateSymLink() calls cifs_strtoUTF16
+ CIFSUnixCreateSymLink() calls cifsConvertToUTF16() with remap[BUG3] : forget to convert reserved chars when getting SymbolicLink.
- CIFSSMBUnixQuerySymLink() calls cifs_strtoUTF16
+ CIFSSMBUnixQuerySymLink() calls cifsConvertToUTF16() with remap[BUG4] : /proc/mounts don't show "mapposix" when using mapposix mount option
+ cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR)
+ seq_puts(s, ",mapposix");Reported-by: t.wede@kw-reneg.de
Reported-by: Nakajima Akira
Signed-off-by: Nakajima Akira
Signed-off-by: Carl Schaefer
Signed-off-by: Steve French
16 Apr, 2015
1 commit
-
that's the bulk of filesystem drivers dealing with inodes of their own
Signed-off-by: David Howells
Signed-off-by: Al Viro
17 Oct, 2014
1 commit
-
The "sfu" mount option did not work on SMB2/SMB3 mounts.
With these changes when the "sfu" mount option is passed in
on an smb2/smb2.1/smb3 mount the client can emulate (and
recognize) fifo and device (character and device files).In addition the "sfu" mount option should not conflict
with "mfsymlinks" (symlink emulation) as we will never
create "sfu" style symlinks, but using "sfu" mount option
will allow us to recognize existing symlinks, created with
Microsoft "Services for Unix" (SFU and SUA).To enable the "sfu" mount option for SMB2/SMB3 the calling
syntax of the generic cifs/smb2/smb3 sync_read and sync_write
protocol dependent function needed to be changed (we
don't have a file struct in all cases), but this actually
ended up simplifying the code a little.Signed-off-by: Steve French
09 Oct, 2014
1 commit
-
Signed-off-by: Al Viro
22 Aug, 2014
1 commit
-
Currently cifs have all or nothing approach for directIO operations.
cache=strict mode does not allow directIO while cache=none mode performs
all the operations as directIO even when user does not specify O_DIRECT
flag. This patch enables strict cache mode to honour directIO semantics.Signed-off-by: Namjae Jeon
Signed-off-by: Ashish Sangwan
Signed-off-by: Steve French
11 Feb, 2014
1 commit
-
When mounting with smb2/smb3 (e.g. vers=2.1) and cifsacl mount option,
it was trying to get the mode by querying the acl over the cifs
rather than smb2 protocol. This patch makes that protocol
independent and makes cifsacl smb2 mounts return a more intuitive
operation not supported error (until we add a worker function
for smb2_get_acl).Note that a previous patch fixed getxattr/setxattr for the CIFSACL xattr
which would unconditionally call cifs_get_acl and cifs_set_acl (even when
mounted smb2). I made those protocol independent last week (new protocol
version operations "get_acl" and "set_acl" but did not add an
smb2_get_acl and smb2_set_acl yet so those now simply return EOPNOTSUPP
which at least is better than sending cifs requests on smb2 mount)The previous patches did not fix the one remaining case though ie
mounting with "cifsacl" when getting mode from acl would unconditionally
end up calling "cifs_get_acl_from_fid" even for smb2 - so made that protocol
independent but to make that protocol independent had to make sure that the callers
were passing the protocol independent handle structure (cifs_fid) instead
of cifs specific _u16 network file handle (ie cifs_fid instead of cifs_fid->fid)Now mount with smb2 and cifsacl mount options will return EOPNOTSUP (instead
of timing out) and a future patch will add smb2 operations (e.g. get_smb2_acl)
to enable this.Signed-off-by: Steve French
20 Jan, 2014
2 commits
-
Rename CIFSSMBOpen to CIFS_open and make it take
cifs_open_parms structure as a parm.Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Rename camel case variable and fix comment style.
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
28 Dec, 2013
1 commit
-
Set FILE_CREATED on O_CREAT|O_EXCL.
cifs code didn't change during commit 116cc0225381415b96551f725455d067f63a76a0
Kernel bugzilla 66251
Signed-off-by: Shirish Pargaonkar
Acked-by: Jeff Layton
CC: Stable
Signed-off-by: Steve French
12 Nov, 2013
1 commit
-
Andrey reported that he was seeing cifs.ko spam the logs with messages
like this:CIFS VFS: Unexpected lookup error -26
He was listing the root directory of a server and hitting an error when
trying to QUERY_PATH_INFO against hiberfil.sys and pagefile.sys. The
right fix would be to switch the lookup code over to using FIND_FIRST,
but until then we really don't need to report this at a level of
KERN_ERR. Convert this message over to FYI level.Reported-by: "Andrey Shernyukov"
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
17 Sep, 2013
1 commit
-
If an error occurs after having called finish_open() then fput() needs to
be called on the already opened file.Signed-off-by: Miklos Szeredi
Cc: Steve French
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro
09 Sep, 2013
1 commit
-
Have the case-insensitive d_compare and d_hash routines convert each
character in the filenames to wchar_t's and then use the new
cifs_toupper routine to convert those into uppercase.With this scheme we should more closely emulate the case conversion that
the servers will do.Reported-and-Tested-by: Jan-Marek Glogowski
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
11 Jul, 2013
2 commits
-
On reconnects, we need to reopen file and then obtain all byte-range
locks held by the client. SMB2 protocol provides feature to make
this process atomic by reconnecting to the same file handle
with all it's byte-range locks. This patch adds this capability
for SMB2 shares.Signed-off-by: Pavel Shilovsky
Signed-off-by: Steven French -
and pass it to the open() call.
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steven French
29 Jun, 2013
1 commit
-
Instances either don't look at it at all (the majority of cases) or
only want it to find the superblock (which can be had as dentry->d_sb).
A few cases that want more are actually safe with dentry->d_inode -
the only precaution needed is the check that it hadn't been replaced with
NULL by rmdir() or by overwriting rename(), which case should be simply
treated as cache miss.Signed-off-by: Linus Torvalds
Signed-off-by: Al Viro
05 May, 2013
2 commits
-
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.Signed-off-by: Wei Yongjun
Reviewed-by: Jeff Layton
Signed-off-by: Steve French
Signed-off-by: Steve French -
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
13 Feb, 2013
1 commit
-
Use INVALID_UID and INVALID_GID instead of NO_CHANGE_64 to indicate
the value should not be changed.In cifs_fill_unix_set_info convert from kuids and kgids into uids and
gids that will fit in FILE_UNIX_BASIC_INFO.Cc: Steve French
Signed-off-by: "Eric W. Biederman"
12 Dec, 2012
1 commit
-
Currently the code takes care to ensure that the prefixpath has a
leading '/' delimiter. What if someone passes us a prefixpath with a
leading '\\' instead? The code doesn't properly handle that currently
AFAICS.Let's just change the code to skip over any leading delimiter character
when copying the prepath. Then, fix up the users of the prepath option
to prefix it with the correct delimiter when they use it.Also, there's no need to limit the length of the prefixpath to 1k. If
the server can handle it, why bother forbidding it?Pavel Shilovsky
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
06 Dec, 2012
1 commit
-
because the is no difference here. This also adds support of prefixpath
mount option for SMB2.Signed-off-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Steve French
05 Nov, 2012
1 commit
-
We do not need to lookup a hashed negative directory since we have
already revalidated it before and have found it to be fine.This also prevents a crash in cifs_lookup() when it attempts to rehash
the already hashed negative lookup dentry.The patch has been tested using the reproducer at
https://bugzilla.redhat.com/show_bug.cgi?id=867344#c28Cc: # 3.6.x
Reported-by: Vit Zahradka
Signed-off-by: Sachin Prabhu
25 Sep, 2012
4 commits
-
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
Signed-off-by: Steve French -
if server supports them and we need oplocks.
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Acked-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
20 Aug, 2012
1 commit
-
Commit d2c127197dfc0b2bae62a52e1e0d3e3ff493919e caused a regression
in cifs_do_create error handling. Fix this by closing a file handle
in the case of a get_inode_info(_unix) error. Also remove unnecessary
checks for newinode being NULL.Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
25 Jul, 2012
2 commits
-
Since both CIFS and SMB2 use ses->capabilities (server->capabilities)
field but flags are different we should make such checks protocol
independent.Reviewed-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Commit 30d904947459cca2beb69e0110716f5248b31f2a caused a regression
in cifs open codepath.Reviewed-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
24 Jul, 2012
1 commit
-
Acked-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
14 Jul, 2012
2 commits
-
boolean "does it have to be exclusive?" flag is passed instead;
Local filesystem should just ignore it - the object is guaranteed
not to be there yet.Signed-off-by: Al Viro
-
Just the flags; only NFS cares even about that, but there are
legitimate uses for such argument. And getting rid of that
completely would require splitting ->lookup() into a couple
of methods (at least), so let's leave that alone for now...Signed-off-by: Al Viro