01 Aug, 2011
12 commits
-
Reviewed-and-Tested-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Reviewed-and-Tested-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Reviewed-and-Tested-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Move reading to separate function and remove csocket variable.
Also change semantic in a little: goto incomplete_rcv only when
we get -EAGAIN (or a familiar error) while reading rfc1002 header.
In this case we don't check for echo timeout when we don't get whole
header at once, as it was before.Reviewed-and-Tested-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Reviewed-and-Tested-by: Jeff Layton
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French -
Reported-and-acked-by: David Howells
Signed-off-by: Jeff Layton
Signed-off-by: Steve French -
Currently, we take a sb->s_active reference and a cifsFileInfo reference
when an oplock break workqueue job is queued. This is unnecessary and
more complicated than it needs to be. Also as Al points out,
deactivate_super has non-trivial locking implications so it's best to
avoid that if we can.Instead, just cancel any pending oplock breaks for this filehandle
synchronously in cifsFileInfo_put after taking it off the lists.
That should ensure that this job doesn't outlive the structures it
depends on.Reported-by: Al Viro
Signed-off-by: Jeff Layton
Signed-off-by: Steve French -
The recent fix to the above function causes this compiler warning to pop
on some gcc versions:CC [M] fs/cifs/cifssmb.o
fs/cifs/cifssmb.c: In function ‘CIFSSMBQAllEAs’:
fs/cifs/cifssmb.c:5708: warning: ‘ea_name_len’ may be used uninitialized in
this functionSigned-off-by: Jeff Layton
Signed-off-by: Steve French -
The code that matches EA names in CIFSSMBQAllEAs is incorrect. It
uses strncmp to do the comparison with the length limited to the
name_len sent in the response.Problem: Suppose we're looking for an attribute named "foobar" and
have an attribute before it in the EA list named "foo". The
comparison will succeed since we're only looking at the first 3
characters. Fix this by also comparing the length of the provided
ea_name with the name_len in the response. If they're not equal then
it shouldn't match.Reported-by: Jian Li
Signed-off-by: Jeff Layton
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French -
Sniffing traffic on the wire shows that windows clients send a zeroed
out signature field in a NEGOTIATE request, and send "BSRSPYL" in the
signature field during SESSION_SETUP. Make the cifs client behave the
same way.It doesn't seem to make much difference in any server that I've tested
against, but it's probably best to follow windows behavior as closely as
possible here.Signed-off-by: Jeff Layton
Reviewed-by: Shirish Pargaonkar
Signed-off-by: Steve French -
...and remove some obsolete comments.
Signed-off-by: Jeff Layton
Signed-off-by: Steve French -
Currently, we mirror the same size back to the server that it sends us.
That makes little sense. Instead we should be sending the server the
maximum buffer size that we can handle -- CIFSMaxBufSize minus the
4 byte RFC1001 header.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
27 Jul, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: Cleanup: check return codes of crypto api calls
CIFS: Fix oops while mounting with prefixpath
[CIFS] Redundant null check after dereference
cifs: use cifs_dirent in cifs_save_resume_key
cifs: use cifs_dirent to replace cifs_get_name_from_search_buf
cifs: introduce cifs_dirent
cifs: cleanup cifs_filldir
26 Jul, 2011
8 commits
-
Check return codes of crypto api calls and either log an error or log
an error and return from the calling function with error.Signed-off-by: Shirish Pargaonkar
Signed-off-by: Steve French -
commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc caused
a regression when we have already mounted //server/share/a
and want to mount //server/share/a/b.The problem is that lookup_one_len calls __lookup_hash
with nd pointer as NULL. Then __lookup_hash calls
do_revalidate in the case when dentry exists and we end
up with NULL pointer deference in cifs_d_revalidate:if (nd->flags & LOOKUP_RCU)
return -ECHILD;Fix this by checking nd for NULL.
Signed-off-by: Pavel Shilovsky
Reviewed-by: Shirish Pargaonkar
CC: Stable
Signed-off-by: Steve French -
Reviewed-by: Shirish Pargaonkar
Signed-off-by: Steve French -
Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton
Signed-off-by: Steve French -
This allows us to parse the on the wire structures only once in
cifs_filldir.Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton
Signed-off-by: Steve French -
Introduce a generic directory entry structure, and factor the parsing
of the various on the wire structures that can represent one into
a common helper. Switch cifs_entry_is_dot over to use it as a start.Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton
Signed-off-by: Steve French -
Use sensible variable names and formatting and remove some superflous
checks on entry.Signed-off-by: Christoph Hellwig
Reviewed-by: Jeff Layton
Signed-off-by: Steve French -
commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc caused
a regression when we have already mounted //server/share/a
and want to mount //server/share/a/b.The problem is that lookup_one_len calls __lookup_hash
with nd pointer as NULL. Then __lookup_hash calls
do_revalidate in the case when dentry exists and we end
up with NULL pointer deference in cifs_d_revalidate:if (nd->flags & LOOKUP_RCU)
return -ECHILD;Fix this by checking nd for NULL.
Signed-off-by: Pavel Shilovsky
Signed-off-by: Al Viro
23 Jul, 2011
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
isofs: Remove global fs lock
jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
mm/truncate.c: fix build for CONFIG_BLOCK not enabled
fs:update the NOTE of the file_operations structure
Remove dead code in dget_parent()
AFS: Fix silly characters in a comment
switch d_add_ci() to d_splice_alias() in "found negative" case as well
simplify gfs2_lookup()
jfs_lookup(): don't bother with . or ..
get rid of useless dget_parent() in btrfs rename() and link()
get rid of useless dget_parent() in fs/btrfs/ioctl.c
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
drivers: fix up various ->llseek() implementations
fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
Ext4: handle SEEK_HOLE/SEEK_DATA generically
Btrfs: implement our own ->llseek
fs: add SEEK_HOLE and SEEK_DATA flags
reiserfs: make reiserfs default to barrier=flush
...Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
shrinker callout for the inode cache, that clashed with the xfs code to
start the periodic workers later.
21 Jul, 2011
4 commits
-
Signed-off-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Steve French -
Btrfs needs to be able to control how filemap_write_and_wait_range() is called
in fsync to make it less of a painful operation, so push down taking i_mutex and
the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
file systems can drop taking the i_mutex altogether it seems, like ext3 and
ocfs2. For correctness sake I just pushed everything down in all cases to make
sure that we keep the current behavior the same for everybody, and then each
individual fs maintainer can make up their mind about what to do from there.
Thanks,Acked-by: Jan Kara
Signed-off-by: Josef Bacik
Signed-off-by: Al Viro -
This converts everybody to handle SEEK_HOLE/SEEK_DATA properly. In some cases
we just return -EINVAL, in others we do the normal generic thing, and in others
we're simply making sure that the properly due-dilligence is done. For example
in NFS/CIFS we need to make sure the file size is update properly for the
SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
that is all we have to do. Thanks,Signed-off-by: Josef Bacik
Signed-off-by: Al Viro -
Signed-off-by: Al Viro
20 Jul, 2011
8 commits
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
... it will be set in nd->flag for all cases with non-NULL nd
(i.e. when called from do_last()).Signed-off-by: Al Viro
-
... and get rid of a bogus typecast, while we are at it; it's not
just that we want a function returning int and not void, but cast
to pointer to function taking void * and returning void would be
(void (*)(void *)) and not (void *)(void *), TYVM...Signed-off-by: Al Viro
-
not used by the instances anymore.
Signed-off-by: Al Viro
-
redundant; all callers get it duplicated in mask & MAY_NOT_BLOCK and none of
them removes that bit.Signed-off-by: Al Viro
-
its value depends only on inode and does not change; we might as
well store it in ->i_op->check_acl and be done with that.Signed-off-by: Al Viro
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
vfs: fix race in rcu lookup of pruned dentry
Fix cifs_get_root()[ Edited the last commit to get rid of a 'unused variable "seq"'
warning due to Al editing the patch. - Linus ]
19 Jul, 2011
2 commits
-
Add missing ->i_mutex, convert to lookup_one_len() instead of
(broken) open-coded analog, cope with getting something like
a//b as relative pathname. Simplify the hell out of it, while
we are there...Signed-off-by: Al Viro
Reviewed-by: Jeff Layton -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
hppfs_lookup(): don't open-code lookup_one_len()
hppfs: fix dentry leak
cramfs: get_cramfs_inode() returns ERR_PTR() on failure
ufs should use d_splice_alias()
fix exofs ->get_parent()
ceph analog of cifs build_path_from_dentry() race fix
cifs: build_path_from_dentry() race fix
17 Jul, 2011
1 commit
-
deal with d_move() races properly; rename_lock read-retry loop,
rcu_read_lock() held while walking to root, d_lock held over
subtraction from namelen and copying the component to stabilize
->d_name.Signed-off-by: Al Viro
13 Jul, 2011
3 commits
-
Signed-off-by: Steve French
-
In 34c87901e113 "Shrink stack space usage in cifs_construct_tcon" we
change the size of the username name buffer from MAX_USERNAME_SIZE
(256) to 28. This call to snprintf() needs to be updated as well.
Reported by Dan Carpenter.Reviewed-by: Dan Carpenter
Signed-off-by: Steve French -
When using NTLMSSP authentication mechanism, if server mandates
signing, keep the flags in type 3 messages of the NTLMSSP exchange
same as in type 1 messages (i.e. keep the indicated capabilities same).Some of the servers such as Samba, expect the flags such as
Negotiate_Key_Exchange in type 3 message of NTLMSSP exchange as well.
Some servers like Windows do not.https://bugzilla.samba.org/show_bug.cgi?id=8212
Signed-off-by: Shirish Pargaonkar
Acked-by: Jeff Layton
Signed-off-by: Steve French