08 Feb, 2011

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (33 commits)
    Btrfs: Fix page count calculation
    btrfs: Drop __exit attribute on btrfs_exit_compress
    btrfs: cleanup error handling in btrfs_unlink_inode()
    Btrfs: exclude super blocks when we read in block groups
    Btrfs: make sure search_bitmap finds something in remove_from_bitmap
    btrfs: fix return value check of btrfs_start_transaction()
    btrfs: checking NULL or not in some functions
    Btrfs: avoid uninit variable warnings in ordered-data.c
    Btrfs: catch errors from btrfs_sync_log
    Btrfs: make shrink_delalloc a little friendlier
    Btrfs: handle no memory properly in prepare_pages
    Btrfs: do error checking in btrfs_del_csums
    Btrfs: use the global block reserve if we cannot reserve space
    Btrfs: do not release more reserved bytes to the global_block_rsv than we need
    Btrfs: fix check_path_shared so it returns the right value
    btrfs: check return value of btrfs_start_ioctl_transaction() properly
    btrfs: fix return value check of btrfs_join_transaction()
    fs/btrfs/inode.c: Add missing IS_ERR test
    btrfs: fix missing break in switch phrase
    btrfs: fix several uncheck memory allocations
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: remove checks for ses->status == CifsExiting
    cifs: add check for kmalloc in parse_dacl
    cifs: don't send an echo request unless NegProt has been done
    cifs: enable signing flag in SMB header when server has it on
    cifs: Possible slab memory corruption while updating extended stats (repost)
    CIFS: Fix variable types in cifs_iovec_read/write (try #2)
    cifs: fix length vs. total_read confusion in cifs_demultiplex_thread

    Linus Torvalds
     
  • take offset of start position into account when calculating page count.

    Signed-off-by: Yan, Zheng
    Signed-off-by: Chris Mason

    Yan, Zheng
     
  • ses->status is never set to CifsExiting, so these checks are
    always false.

    Tested-by: JG
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

06 Feb, 2011

5 commits

  • As this function is called in some error paths while not
    removing the module, the __exit attribute prevents the kernel
    image from linking when btrfs is compiled in statically.

    Signed-off-by: Alexey Charkov
    Signed-off-by: Chris Mason

    Alexey Charkov
     
  • When btrfs_alloc_path() fails, btrfs_free_path() need not be called.
    Therefore, it changes the branch ahead.

    Signed-off-by: Tsutomu Itoh
    Signed-off-by: Chris Mason

    Tsutomu Itoh
     
  • This has been resulting in a BUT_ON(ret) after btrfs_reserve_extent in
    btrfs_cow_file_range. The reason is we don't actually calculate the bytes_super
    for a block group until we go to cache it, which means that the space_info can
    hand out reservations for space that it doesn't actually have, and we can run
    out of data space. This is also a problem if you are using space caching since
    we don't ever calculate bytes_super for the block groups. So instead everytime
    we read a block group call exclude_super_stripes, which calculates the
    bytes_super for the block group so it can be left out of the space_info. Then
    whenever caching completes we just call free_excluded_extents so that the super
    excluded extents are freed up. Also if we are unmounting and we hit any block
    groups that haven't been cached we still need to call free_excluded_extents to
    make sure things are cleaned up properly. Thanks,

    Reported-by: Arne Jansen
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • When we're cleaning up the tree log we need to be able to remove free space from
    the block group. The problem is if that free space spans bitmaps we would not
    find the space since we're looking for too many bytes. So make sure the amount
    of bytes we search for is limited to either the number of bytes we want, or the
    number of bytes left in the bitmap. This was tested by a user who was hitting
    the BUG() after search_bitmap. With this patch he can now mount his fs.
    Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • Exit from parse_dacl if no memory returned from the call to kmalloc.

    Signed-off-by: Stanislav Fomichev
    Signed-off-by: Steve French

    Stanislav Fomichev
     

05 Feb, 2011

4 commits

  • When the socket to the server is disconnected, the client more or less
    immediately calls cifs_reconnect to reconnect the socket. The NegProt
    and SessSetup however are not done until an actual call needs to be
    made.

    With the addition of the SMB echo code, it's possible that the server
    will initiate a disconnect on an idle socket. The client will then
    reconnect the socket but no NegotiateProtocol request is done. The
    SMBEcho workqueue job will then eventually pop, and an SMBEcho will be
    sent on the socket. The server will then reject it since no NegProt was
    done.

    The ideal fix would be to either have the socket not be reconnected
    until we plan to use it, or to immediately do a NegProt when the
    reconnect occurs. The code is not structured for this however. For now
    we must just settle for not sending any echoes until the NegProt is
    done.

    Reported-by: JG
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • cifs_sign_smb only generates a signature if the correct Flags2 bit is
    set. Make sure that it gets set correctly if we're sending an async
    call.

    This patch fixes:

    https://bugzilla.kernel.org/show_bug.cgi?id=28142

    Reported-and-Tested-by: JG
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Updating extended statistics here can cause slab memory corruption
    if a callback function frees slab memory (mid_entry).

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

    Shirish Pargaonkar
     
  • In get_empty_filp() since 2.6.29, file_free(f) is called with f->f_cred == NULL
    when security_file_alloc() returned an error. As a result, kernel will panic()
    due to put_cred(NULL) call within RCU callback.

    Fix this bug by assigning f->f_cred before calling security_file_alloc().

    Signed-off-by: Tetsuo Handa
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Tetsuo Handa
     

04 Feb, 2011

6 commits


03 Feb, 2011

4 commits

  • This reverts commit 115e19c53501edc11f730191f7f047736815ae3d.

    Apparently setting inode->bdi to one's own sb->s_bdi stops VFS from
    sending *read-aheads*. This problem was bisected to this commit. A
    revert fixes it. I'll investigate farther why is this happening for the
    next Kernel, but for now a revert.

    I'm sending to stable@kernel.org as well, since it exists also in
    2.6.37. 2.6.36 is good and does not have this patch.

    CC: Stable Tree
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Linus Torvalds

    Boaz Harrosh
     
  • Some filesystems don't deal well with being asked to map less than
    blocksize blocks (GFS2 for example). Since we are always mapping at least
    blocksize sections anyway, just make sure len is at least as big as a
    blocksize so we don't trip up any filesystems. Thanks,

    Signed-off-by: Josef Bacik
    Cc: Steven Whitehouse
    Cc: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef Bacik
     
  • FMODE_EXEC is a constant type of fmode_t but was used with normal integer
    constants. This results in following warnings from sparse. Fix it using
    new macro __FMODE_EXEC.

    fs/exec.c:116:58: warning: restricted fmode_t degrades to integer
    fs/exec.c:689:58: warning: restricted fmode_t degrades to integer
    fs/fcntl.c:777:9: warning: restricted fmode_t degrades to integer

    Signed-off-by: Namhyung Kim
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • commit 95aac7b1cd224f ("epoll: make epoll_wait() use the hrtimer range
    feature") added a performance regression because it uses timespec_add_ns()
    with potential very large 'ns' values.

    [akpm@linux-foundation.org: s/epoll_set_mstimeout/ep_set_mstimeout/, per Davide]
    Reported-by: Simon Kirby
    Signed-off-by: Eric Dumazet
    Cc: Shawn Bohrer
    Acked-by: Davide Libenzi
    Cc: [2.6.37.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

02 Feb, 2011

2 commits

  • length at this point is the length returned by the last kernel_recvmsg
    call. total_read is the length of all of the data read so far. length
    is more or less meaningless at this point, so use total_read for
    everything.

    Signed-off-by: Jeff Layton
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Jeff Layton
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: fix length checks in checkSMB
    [CIFS] Update cifs minor version
    cifs: No need to check crypto blockcipher allocation
    cifs: clean up some compiler warnings
    cifs: make CIFS depend on CRYPTO_MD4
    cifs: force a reconnect if there are too many MIDs in flight
    cifs: don't pop a printk when sending on a socket is interrupted
    cifs: simplify SMB header check routine
    cifs: send an NT_CANCEL request when a process is signalled
    cifs: handle cancelled requests better
    cifs: fix two compiler warning about uninitialized vars

    Linus Torvalds
     

01 Feb, 2011

10 commits

  • The error check of btrfs_start_transaction() is added, and the mistake
    of the error check on several places is corrected.

    Signed-off-by: Tsutomu Itoh
    Signed-off-by: Chris Mason

    Tsutomu Itoh
     
  • Because NULL is returned when the memory allocation fails,
    it is checked whether it is NULL.

    Signed-off-by: Tsutomu Itoh
    Signed-off-by: Chris Mason

    Tsutomu Itoh
     
  • This one isn't really an uninit variable, but for pretty
    obscure reasons. Let's make it clearly correct.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFS: NFSv4 readdir loses entries
    NFS: Micro-optimize nfs4_decode_dirent()
    NFS: Fix an NFS client lockdep issue
    NFS construct consistent co_ownerid for v4.1
    NFS: nfs_wcc_update_inode() should set nfsi->attr_gencount
    NFS improve pnfs_put_deviceid_cache debug print
    NFS fix cb_sequence error processing
    NFS do not find client in NFSv4 pg_authenticate
    NLM: Fix "kernel BUG at fs/lockd/host.c:417!" or ".../host.c:283!"
    NFS: Prevent memory allocation failure in nfsacl_encode()
    NFS: nfsacl_{encode,decode} should return signed integer
    NFS: Fix "kernel BUG at fs/nfs/nfs3xdr.c:1338!"
    NFS: Fix "kernel BUG at fs/aio.c:554!"
    NFS4: Avoid potential NULL pointer dereference in decode_and_add_ds().
    NFS: fix handling of malloc failure during nfs_flush_multi()

    Linus Torvalds
     
  • The cERROR message in checkSMB when the calculated length doesn't match
    the RFC1001 length is incorrect in many cases. It always says that the
    RFC1001 length is bigger than the SMB, even when it's actually the
    reverse.

    Fix the error message to say the reverse of what it does now when the
    SMB length goes beyond the end of the received data. Also, clarify the
    error message when the RFC length is too big. Finally, clarify the
    comments to show that the 512 byte limit on extra data at the end of
    the packet is arbitrary.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: xfs_bmap_add_extent_delay_real should init br_startblock
    xfs: fix dquot shaker deadlock
    xfs: handle CIl transaction commit failures correctly
    xfs: limit extsize to size of AGs and/or MAXEXTLEN
    xfs: prevent extsize alignment from exceeding maximum extent size
    xfs: limit extent length for allocation to AG size
    xfs: speculative delayed allocation uses rounddown_power_of_2 badly
    xfs: fix efi item leak on forced shutdown
    xfs: fix log ticket leak on forced shutdown.

    Linus Torvalds
     
  • Signed-off-by: Steve French

    Steve French
     
  • btrfs_sync_log returns -EAGAIN when we need full transaction commits
    instead of small log commits, but sometimes we were dropping the return
    value.

    In practice, we check for this a few different ways, but this is still a
    bug that can leave off full log commits when we really need them.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • Xfstests 224 will just sit there and spin for ever until eventually we give up
    flushing delalloc and exit. On my box this took several hours. I could not
    interrupt this process either, even though we use INTERRUPTIBLE. So do 2 things

    1) Keep us from looping over and over again without reclaiming anything
    2) If we get interrupted exit the loop

    I tested this and the test now exits in a reasonable amount of time, and can be
    interrupted with ctrl+c. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • Missed one change as per earlier suggestion.

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

    Shirish Pargaonkar
     

31 Jan, 2011

5 commits

  • New compiler warnings that I noticed when building a patchset based
    on recent Fedora kernel:

    fs/cifs/cifssmb.c: In function 'CIFSSMBSetFileSize':
    fs/cifs/cifssmb.c:4813:8: warning: variable 'data_offset' set but not used
    [-Wunused-but-set-variable]

    fs/cifs/file.c: In function 'cifs_open':
    fs/cifs/file.c:349:24: warning: variable 'pCifsInode' set but not used
    [-Wunused-but-set-variable]
    fs/cifs/file.c: In function 'cifs_partialpagewrite':
    fs/cifs/file.c:1149:23: warning: variable 'cifs_sb' set but not used
    [-Wunused-but-set-variable]
    fs/cifs/file.c: In function 'cifs_iovec_write':
    fs/cifs/file.c:1740:9: warning: passing argument 6 of 'CIFSSMBWrite2' from
    incompatible pointer type [enabled by default]
    fs/cifs/cifsproto.h:337:12: note: expected 'unsigned int *' but argument is
    of type 'size_t *'

    fs/cifs/readdir.c: In function 'cifs_readdir':
    fs/cifs/readdir.c:767:23: warning: variable 'cifs_sb' set but not used
    [-Wunused-but-set-variable]

    fs/cifs/cifs_dfs_ref.c: In function 'cifs_dfs_d_automount':
    fs/cifs/cifs_dfs_ref.c:342:2: warning: 'rc' may be used uninitialized in
    this function [-Wuninitialized]
    fs/cifs/cifs_dfs_ref.c:278:6: note: 'rc' was declared here

    Signed-off-by: Jeff Layton
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Jeff Layton
     
  • Recently CIFS was changed to use the kernel crypto API for MD4 hashes,
    but the Kconfig dependencies were not changed to reflect this.

    Signed-off-by: Jeff Layton
    Reported-and-Tested-by: Suresh Jayaraman
    Reviewed-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Jeff Layton
     
  • Currently, we allow the pending_mid_q to grow without bound with
    SIGKILL'ed processes. This could eventually be a DoS'able problem. An
    unprivileged user could a process that does a long-running call and then
    SIGKILL it.

    If he can also intercept the NT_CANCEL calls or the replies from the
    server, then the pending_mid_q could grow very large, possibly even to
    2^16 entries which might leave GetNextMid in an infinite loop. Fix this
    by imposing a hard limit of 32k calls per server. If we cross that
    limit, set the tcpStatus to CifsNeedReconnect to force cifsd to
    eventually reconnect the socket and clean out the pending_mid_q.

    While we're at it, clean up the function a bit and eliminate an
    unnecessary NULL pointer check.

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

    Jeff Layton
     
  • If we kill the process while it's sending on a socket then the
    kernel_sendmsg will return -EINTR. This is normal. No need to spam the
    ring buffer with this info.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • ...just cleanup. There should be no behavior change.

    Signed-off-by: Jeff Layton
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Jeff Layton