01 Jan, 2009
1 commit
-
Remove the hopelessly misguided ->dir_notify(). The only instance (cifs)
has been broken by design from the very beginning; the objects it creates
are never destroyed, keep references to struct file they can outlive, nothing
that could possibly evict them exists on close(2) path *and* no locking
whatsoever is done to prevent races with close(), should the previous, er,
deficiencies someday be dealt with.Signed-off-by: Al Viro
29 Dec, 2008
1 commit
-
Signed-off-by: Stephen Rothwell
Signed-off-by: Linus Torvalds
26 Dec, 2008
3 commits
-
Signed-off-by: Steve French
-
Now that tasks sleeping in wait_for_response will time out on their own,
we're not reliant on the dnotify thread to do this. Mark it as
experimental code for now.Signed-off-by: Jeff Layton
Signed-off-by: Steve French -
Have cifs_show_options display the addr and prefixpath options in
/proc/mounts. Reduce struct dereferencing by adding some local
variables.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
17 Nov, 2008
1 commit
-
Use a similar approach to the SMB session sharing. Add a list of tcons
attached to each SMB session. Move the refcount to non-atomic. Protect
all of the above with the cifs_tcp_ses_lock. Add functions to
properly find and put references to the tcons.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
15 Nov, 2008
2 commits
-
We do this by abandoning the global list of SMB sessions and instead
moving to a per-server list. This entails adding a new list head to the
TCP_Server_Info struct. The refcounting for the cifsSesInfo is moved to
a non-atomic variable. We have to protect it by a lock anyway, so there's
no benefit to making it an atomic. The list and refcount are protected
by the global cifs_tcp_ses_lock.The patch also adds a new routines to find and put SMB sessions and
that properly take and put references under the lock.Signed-off-by: Jeff Layton
Signed-off-by: Steve French -
The code that allows these structs to be shared is extremely racy.
Disable the sharing of SMB and tcon structs for now until we can
come up with a way to do this that's race free.We want to continue to share TCP sessions, however since they are
required for multiuser mounts. For that, implement a new (hopefully
race-free) scheme. Add a new global list of TCP sessions, and take
care to get a reference to it whenever we're dealing with one.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
14 Nov, 2008
2 commits
-
Also adds two lines missing from the previous patch (for the need reconnect flag in the
/proc/fs/cifs/DebugData handling)The new global_cifs_sock_list is added, and initialized in init_cifs but not used yet.
Jeff Layton will be adding code in to use that and to remove the GlobalTcon and GlobalSMBSession
lists.CC: Jeff Layton
CC: Shirish Pargaonkar
Signed-off-by: Steve French -
In preparation for Jeff's big umount/mount fixes to remove the possibility of
various races in cifs mount and linked list handling of sessions, sockets and
tree connections, this patch cleans up some repetitive code in cifs_mount,
and addresses a problem with ses->status and tcon->tidStatus in which we
were overloading the "need_reconnect" state with other status in that
field. So the "need_reconnect" flag has been broken out from those
two state fields (need reconnect was not mutually exclusive from some of the
other possible tid and ses states). In addition, a few exit cases in
cifs_mount were cleaned up, and a problem with a tcon flag (for lease support)
was not being set consistently for the 2nd mount of the same shareCC: Jeff Layton
CC: Shirish Pargaonkar
Signed-off-by: Steve French
24 Oct, 2008
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: handle the TCP_Server_Info->tsk field more carefully
cifs: fix unlinking of rename target when server doesn't support open file renames
[CIFS] improve setlease handling
[CIFS] fix saving of resume key before CIFSFindNext
cifs: make cifs_rename handle -EACCES errors
[CIFS] fix build error
[CIFS] undo changes in cifs_rename_pending_delete if it errors out
cifs: track DeletePending flag in cifsInodeInfo
cifs: don't use CREATE_DELETE_ON_CLOSE in cifs_rename_pending_delete
[CIFS] eliminate usage of kthread_stop for cifsd
[CIFS] Add nodfs mount option
23 Oct, 2008
3 commits
-
For execute permission on a regular files we need to check if file has
any execute bits at all, regardless of capabilites.This check is normally performed by generic_permission() but was also
added to the case when the filesystem defines its own ->permission()
method. In the latter case the filesystem should be responsible for
performing this check.Move the check from inode_permission() inside filesystems which are
not calling generic_permission().Create a helper function execute_ok() that returns true if the inode
is a directory or if any execute bits are present in i_mode.Also fix up the following code:
- coda control file is never executable
- sysctl files are never executable
- hfs_permission seems broken on MAY_EXEC, remove
- hfsplus_permission is eqivalent to generic_permission(), removeSigned-off-by: Miklos Szeredi
-
With this patch all directory fops instances that have a readdir
that doesn't take the BKL are switched to generic_file_llseek.Signed-off-by: Christoph Hellwig
-
fcntl(F_SETLEASE) currently is not exported by cifs (nor by local file
systems) so cifs grants leases based on how other local processes have
opened the file not by whether the file is cacheable (oplocked). This
adds the check to make sure that the file is cacheable on the client
before checking whether we can grant the lease locally
(generic_setlease). It also adds a mount option for cifs (locallease)
if the user wants to override this and try to grant leases even
if the server did not grant oplock.Signed-off-by: Steve French
20 Oct, 2008
1 commit
-
cifs: track DeletePending flag in cifsInodeInfo
The QPathInfo call returns a flag that indicates whether DELETE_ON_CLOSE
is set. Track it in the cifsInodeInfo.Signed-off-by: Jeff Layton
Signed-off-by: Steve French
12 Aug, 2008
2 commits
-
Signed-off-by: Steve French
-
CC: Stable Kernel
Signed-off-by: Steve French
09 Aug, 2008
1 commit
-
Signed-off-by: Steve French
27 Jul, 2008
2 commits
-
* kill nameidata * argument; map the 3 bits in ->flags anybody cares
about to new MAY_... ones and pass with the mask.
* kill redundant gfs2_iop_permission()
* sanitize ecryptfs_permission()
* fix remaining places where ->permission() instances might barf on new
MAY_... found in mask.The obvious next target in that direction is permission(9)
folded fix for nfs_permission() breakage from Miklos Szeredi
Signed-off-by: Al Viro
-
Kmem cache passed to constructor is only needed for constructors that are
themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
passed kmem cache in non-trivial way, so pass only pointer to object.Non-trivial places are:
arch/powerpc/mm/init_64.c
arch/powerpc/mm/hugetlbpage.cThis is flag day, yes.
Signed-off-by: Alexey Dobriyan
Acked-by: Pekka Enberg
Acked-by: Christoph Lameter
Cc: Jon Tollefson
Cc: Nick Piggin
Cc: Matt Mackall
[akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
[akpm@linux-foundation.org: fix mm/slab.c]
[akpm@linux-foundation.org: fix ubifs]
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Jul, 2008
1 commit
03 Jul, 2008
1 commit
-
- Replace remote_llseek with generic_file_llseek_unlocked (to force compilation
failures in all users)
- Change all users to either use generic_file_llseek_unlocked directly or
take the BKL around. I changed the file systems who don't use the BKL
for anything (CIFS, GFS) to call it directly. NCPFS and SMBFS and NFS
take the BKL, but explicitely in their own source now.I moved them all over in a single patch to avoid unbisectable sections.
Open problem: 32bit kernels can corrupt fpos because its modification
is not atomic, but they can do that anyways because there's other paths who
modify it without BKL.Do we need a special lock for the pos/f_version = 0 checks?
Trond says the NFS BKL is likely not needed, but keep it for now
until his full audit.v2: Use generic_file_llseek_unlocked instead of remote_llseek_unlocked
and factor duplicated code (suggested by hch)Cc: Trond.Myklebust@netapp.com
Cc: swhiteho@redhat.com
Cc: sfrench@samba.org
Cc: vandrove@vc.cvut.czSigned-off-by: Andi Kleen
Signed-off-by: Andi Kleen
Signed-off-by: Jonathan Corbet
11 Jun, 2008
1 commit
-
simple "mount -t cifs //xxx /mnt" oopsed on strlen of options
http://kerneloops.org/guilty.php?guilty=cifs_get_sb&version=2.6.25-release&start=16711 \
68&end=1703935&class=oopsSigned-off-by: Marcin Slusarz
Acked-by: Jeff Layton
Signed-off-by: Steve French
20 May, 2008
1 commit
-
Also Kari Hurtta noticed a missing check in the same function which is now fixed.
CC: Kari Hurtta
Signed-off-by: Steve French
17 May, 2008
1 commit
-
adds various options to cifs_show_options
(displayed when you cat /proc/mounts with a cifs mount). I limited
the new ones to values that are associated with the mount with the
exception of "seal" (which is a per tree connection property, but I
thought was important enough to show through).Eventually cifs's parse_mount_options also needs to
be rewritten to use the match_token API but that would be a big enough
change that I would prefer that changing parse_mount_options wait
until next release.Signed-off-by: Steve French
15 May, 2008
1 commit
-
cifs_ioctl doesn't seem to need the BKL for anything, so convert it over
to use unlocked_ioctl.Signed-off-by: Andi Kleen
Signed-off-by: Andrew Morton
Signed-off-by: Steve French
29 Apr, 2008
1 commit
-
Signed-off-by: Joe Perches
Signed-off-by: Steve French
28 Apr, 2008
1 commit
-
Signed-off-by: Christoph Hellwig
Signed-off-by: Steve French
25 Apr, 2008
2 commits
-
Signed-off-by: Al Viro
-
Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro
16 Feb, 2008
1 commit
13 Feb, 2008
2 commits
-
Although these experimental operations are not fully implemented, fix the
typo in the definition of the quotactl operations for cifs.Signed-off-by: Roel Kluin
Signed-off-by: Steve French -
Christoph had noticed too many ifdefs in the CIFS code making it
hard to read. This patch removes about a quarter of them from
the C files in cifs by improving a few key ifdefs in the .h files.Signed-off-by: Steve French
08 Feb, 2008
2 commits
-
Signed-off-by: Steve French
-
Stop the CIFS filesystem from using iget() and read_inode(). Replace
cifs_read_inode() with cifs_iget(), and call that instead of iget().
cifs_iget() then uses iget_locked() directly and returns a proper error code
instead of an inode in the event of an error.cifs_read_super() now returns any error incurred when getting the root inode
instead of ENOMEM.cifs_iget() needs examining. The comment "can not call macro FreeXid here
since in a void func" is no longer true.Signed-off-by: David Howells
Cc: Steven French
Acked-by: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jan, 2008
1 commit
-
Signed-off-by: Igor Mammedov
Signed-off-by: Steve French
11 Jan, 2008
1 commit
-
Also cifs_fs_type was made not static for ussage in dfs code.
Signed-off-by: Igor Mammedov
Signed-off-by: Steve French
10 Jan, 2008
1 commit
-
Adds additional option CIFS_DFS_UPCALL to fs/Kconfig for enabling
DFS support. Resolved IP address is saved as a string in the
key payload.Igor has a series of related patches that will follow which finish up
CIFS DFS supportAcked-by: Igor Mammedov
Signed-off-by: Steve French
21 Nov, 2007
1 commit
-
Fix RedHat bug 329431
The idea here is separate "conscious" from "unconscious" flushes.
Conscious flushes are those due to a fsync() or close(). Unconscious
ones are flushes that occur as a side effect of some other operation or
due to memory pressure.Currently, when an error occurs during an unconscious flush (ENOSPC or
EIO), we toss out the page and don't preserve that error to report to
the user when a conscious flush occurs. If after the unconscious flush,
there are no more dirty pages for the inode, the conscious flush will
simply return success even though there were previous errors when writing
out pages. This can lead to data corruption.The easiest way to reproduce this is to mount up a CIFS share that's
very close to being full or where the user is very close to quota. mv
a file to the share that's slightly larger than the quota allows. The
writes will all succeed (since they go to pagecache). The mv will do a
setattr to set the new file's attributes. This calls
filemap_write_and_wait,
which will return an error since all of the pages can't be written out.
Then later, when the flush and release ops occur, there are no more
dirty pages in pagecache for the file and those operations return 0. mv
then assumes that the file was written out correctly and deletes the
original.CIFS already has a write_behind_rc variable where it stores the results
from earlier flushes, but that value is only reported in cifs_close.
Since the VFS ignores the return value from the release operation, this
isn't helpful. We should be reporting this error during the flush
operation.This patch does the following:
1) changes cifs_fsync to use filemap_write_and_wait and cifs_flush and also
sync to check its return code. If it returns successful, they then check
the value of write_behind_rc to see if an earlier flush had reported any
errors. If so, they return that error and clear write_behind_rc.2) sets write_behind_rc in a few other places where pages are written
out as a side effect of other operations and the code waits on them.3) changes cifs_setattr to only call filemap_write_and_wait for
ATTR_SIZE changes.4) makes cifs_writepages accurately distinguish between EIO and ENOSPC
errors when writing out pages.Some simple testing indicates that the patch works as expected and that
it fixes the reproduceable known problem.Acked-by: Dave Kleikamp
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
03 Nov, 2007
1 commit
-
Also, fix the parser to recognize them and set the secType
accordingly. Make CIFSSMBNegotiate not error out automatically
after parsing the securityBlob.Also thanks to Q (Igor) and Simo for their help on this
set of kerberos patches (and Dave Howells for help on the
upcall).Signed-off-by: Jeff Layton
Signed-off-by: Steve French