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

    Al Viro
     

29 Dec, 2008

1 commit


26 Dec, 2008

3 commits


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

    Jeff Layton
     

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

    Jeff Layton
     
  • 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

    Jeff Layton
     

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

    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 share

    CC: Jeff Layton
    CC: Shirish Pargaonkar
    Signed-off-by: Steve French

    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

    Linus Torvalds
     

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(), remove

    Signed-off-by: Miklos Szeredi

    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

    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

    Steve French
     

20 Oct, 2008

1 commit


12 Aug, 2008

2 commits


09 Aug, 2008

1 commit


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

    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.c

    This 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

    Alexey Dobriyan
     

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.cz

    Signed-off-by: Andi Kleen
    Signed-off-by: Andi Kleen
    Signed-off-by: Jonathan Corbet

    Andi Kleen
     

11 Jun, 2008

1 commit


20 May, 2008

1 commit


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

    Steve French
     

15 May, 2008

1 commit


29 Apr, 2008

1 commit


28 Apr, 2008

1 commit


25 Apr, 2008

2 commits


16 Feb, 2008

1 commit


13 Feb, 2008

2 commits


08 Feb, 2008

2 commits

  • Signed-off-by: Steve French

    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

    David Howells
     

25 Jan, 2008

1 commit


11 Jan, 2008

1 commit


10 Jan, 2008

1 commit


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

    Jeff Layton
     

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

    Jeff Layton