02 Dec, 2008

2 commits


01 Dec, 2008

1 commit


28 Nov, 2008

1 commit

  • udf_clear_inode() can leave behind buffers on mapping's i_private list (when
    we truncated preallocation). Call invalidate_inode_buffers() so that the list
    is properly cleaned-up before we return from udf_clear_inode(). This is ugly
    and suggest that we should cleanup preallocation earlier than in clear_inode()
    but currently there's no such call available since drop_inode() is called under
    inode lock and thus is unusable for disk operations.

    Signed-off-by: Jan Kara

    Jan Kara
     

27 Nov, 2008

1 commit

  • The conversion to write_begin/write_end interfaces had a bug where we
    were passing a bad parameter to cifs_readpage_worker. Rather than
    passing the page offset of the start of the write, we needed to pass the
    offset of the beginning of the page. This was reliably showing up as
    data corruption in the fsx-linux test from LTP.

    It also became evident that this code was occasionally doing unnecessary
    read calls. Optimize those away by using the PG_checked flag to indicate
    that the unwritten part of the page has been initialized.

    CC: Nick Piggin
    Acked-by: Dave Kleikamp
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

21 Nov, 2008

2 commits


20 Nov, 2008

3 commits

  • fs/hostfs/hostfs_user.c defines do_readlink() as non-static, and so does
    fs/xfs/linux-2.6/xfs_ioctl.c when CONFIG_XFS_DEBUG=y. So rename
    do_readlink() in hostfs to hostfs_do_readlink().

    I think it's better if XFS guys will also rename their do_readlink(),
    it's not necessary to use such a general name.

    Signed-off-by: WANG Cong
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     
  • Peter Cordes is sorry that he rm'ed his swapfiles while they were in use,
    he then had no pathname to swapoff. It's a curious little oversight, but
    not one worth a lot of hackery. Kudos to Willy Tarreau for turning this
    around from a discussion of synthetic pathnames to how to prevent unlink.
    Mimic immutable: prohibit unlinking an active swapfile in may_delete()
    (and don't worry my little head over the tiny race window).

    Signed-off-by: Hugh Dickins
    Cc: Willy Tarreau
    Acked-by: Christoph Hellwig
    Cc: Peter Cordes
    Cc: Bodo Eggert
    Cc: David Newall
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • I have received some reports of out-of-memory errors on some older AMD
    architectures. These errors are what I would expect to see if
    crypt_stat->key were split between two separate pages. eCryptfs should
    not assume that any of the memory sent through virt_to_scatterlist() is
    all contained in a single page, and so this patch allocates two
    scatterlist structs instead of one when processing keys. I have received
    confirmation from one person affected by this bug that this patch resolves
    the issue for him, and so I am submitting it for inclusion in a future
    stable release.

    Note that virt_to_scatterlist() runs sg_init_table() on the scatterlist
    structs passed to it, so the calls to sg_init_table() in
    decrypt_passphrase_encrypted_session_key() are redundant.

    Signed-off-by: Michael Halcrow
    Reported-by: Paulo J. S. Silva
    Cc: "Leon Woestenberg"
    Cc: Tim Gardner
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     

19 Nov, 2008

1 commit


18 Nov, 2008

7 commits

  • Block ext devt conversion missed md_autodetect_dev() call in
    rescan_partitions() leaving md autodetect unable to see partitions.
    Fix it.

    Signed-off-by: Tejun Heo
    Cc: Neil Brown
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Make add_partition() return pointer to the new hd_struct on success
    and ERR_PTR() value on failure. This change will be used to fix md
    autodetection bug.

    Signed-off-by: Tejun Heo
    Cc: Neil Brown
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Partition stats structure was not freed on devt allocation failure
    path. Fix it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    prevent cifs_writepages() from skipping unwritten pages
    Fixed parsing of mount options when doing DFS submount
    [CIFS] Fix check for tcon seal setting and fix oops on failed mount from earlier patch
    [CIFS] Fix build break
    cifs: reinstate sharing of tree connections
    [CIFS] minor cleanup to cifs_mount
    cifs: reinstate sharing of SMB sessions sans races
    cifs: disable sharing session and tcon and add new TCP sharing code
    [CIFS] clean up server protocol handling
    [CIFS] remove unused list, add new cifs sock list to prepare for mount/umount fix
    [CIFS] Fix cifs reconnection flags
    [CIFS] Can't rely on iov length and base when kernel_recvmsg returns error

    Linus Torvalds
     
  • Fixes a data corruption under heavy stress in which pages could be left
    dirty after all open instances of a inode have been closed.

    In order to write contiguous pages whenever possible, cifs_writepages()
    asks pagevec_lookup_tag() for more pages than it may write at one time.
    Normally, it then resets index just past the last page written before calling
    pagevec_lookup_tag() again.

    If cifs_writepages() can't write the first page returned, it wasn't resetting
    index, and the next call to pagevec_lookup_tag() resulted in skipping all of
    the pages it previously returned, even though cifs_writepages() did nothing
    with them. This can result in data loss when the file descriptor is about
    to be closed.

    This patch ensures that index gets set back to the next returned page so
    that none get skipped.

    Signed-off-by: Dave Kleikamp
    Acked-by: Jeff Layton
    Cc: Shirish S Pargaonkar
    Signed-off-by: Steve French

    Dave Kleikamp
     
  • Since these hit the same routines, and are relatively small, it is easier to review
    them as one patch.

    Fixed incorrect handling of the last option in some cases
    Fixed prefixpath handling convert path_consumed into host depended string length (in bytes)
    Use non default separator if it is provided in the original mount options

    Acked-by: Jeff Layton
    Signed-off-by: Igor Mammedov
    Signed-off-by: Steve French

    Igor Mammedov
     
  • set tcon->ses earlier

    If the inital tree connect fails, we'll end up calling cifs_put_smb_ses
    with a NULL pointer. Fix it by setting the tcon->ses earlier.

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

    Steve French
     

17 Nov, 2008

3 commits


16 Nov, 2008

1 commit

  • Inotify watch removals suck violently.

    To kick the watch out we need (in this order) inode->inotify_mutex and
    ih->mutex. That's fine if we have a hold on inode; however, for all
    other cases we need to make damn sure we don't race with umount. We can
    *NOT* just grab a reference to a watch - inotify_unmount_inodes() will
    happily sail past it and we'll end with reference to inode potentially
    outliving its superblock.

    Ideally we just want to grab an active reference to superblock if we
    can; that will make sure we won't go into inotify_umount_inodes() until
    we are done. Cleanup is just deactivate_super().

    However, that leaves a messy case - what if we *are* racing with
    umount() and active references to superblock can't be acquired anymore?
    We can bump ->s_count, grab ->s_umount, which will almost certainly wait
    until the superblock is shut down and the watch in question is pining
    for fjords. That's fine, but there is a problem - we might have hit the
    window between ->s_active getting to 0 / ->s_count - below S_BIAS (i.e.
    the moment when superblock is past the point of no return and is heading
    for shutdown) and the moment when deactivate_super() acquires
    ->s_umount.

    We could just do drop_super() yield() and retry, but that's rather
    antisocial and this stuff is luser-triggerable. OTOH, having grabbed
    ->s_umount and having found that we'd got there first (i.e. that
    ->s_root is non-NULL) we know that we won't race with
    inotify_umount_inodes().

    So we could grab a reference to watch and do the rest as above, just
    with drop_super() instead of deactivate_super(), right? Wrong. We had
    to drop ih->mutex before we could grab ->s_umount. So the watch
    could've been gone already.

    That still can be dealt with - we need to save watch->wd, do idr_find()
    and compare its result with our pointer. If they match, we either have
    the damn thing still alive or we'd lost not one but two races at once,
    the watch had been killed and a new one got created with the same ->wd
    at the same address. That couldn't have happened in inotify_destroy(),
    but inotify_rm_wd() could run into that. Still, "new one got created"
    is not a problem - we have every right to kill it or leave it alone,
    whatever's more convenient.

    So we can use idr_find(...) == watch && watch->inode->i_sb == sb as
    "grab it and kill it" check. If it's been our original watch, we are
    fine, if it's a newcomer - nevermind, just pretend that we'd won the
    race and kill the fscker anyway; we are safe since we know that its
    superblock won't be going away.

    And yes, this is far beyond mere "not very pretty"; so's the entire
    concept of inotify to start with.

    Signed-off-by: Al Viro
    Acked-by: Greg KH
    Signed-off-by: Linus Torvalds

    Al Viro
     

15 Nov, 2008

3 commits

  • Signed-off-by: Steve French

    Steve French
     
  • 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

5 commits

  • We're currently declaring both a sockaddr_in and sockaddr6_in on the
    stack, but we really only need storage for one of them. Declare a
    sockaddr struct and cast it to the proper type. Also, eliminate the
    protocolType field in the TCP_Server_Info struct. It's redundant since
    we have a sa_family field in the sockaddr anyway.

    We may need to revisit this if SCTP is ever implemented, but for now
    this will simplify the code.

    CIFS over IPv6 also has a number of problems currently. This fixes all
    of them that I found. Eventually, it would be nice to move more of the
    code to be protocol independent, but this is a start.

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

    Steve French
     
  • 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
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
    dlm: fix shutdown cleanup

    Linus Torvalds
     
  • 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
     
  • Fixes a regression from commit 0f8e0d9a317406612700426fad3efab0b7bbc467,
    "dlm: allow multiple lockspace creates".

    An extraneous 'else' slipped into a code fragment being moved from
    release_lockspace() to dlm_release_lockspace(). The result of the
    unwanted 'else' is that dlm threads and structures are not stopped
    and cleaned up when the final dlm lockspace is removed. Trying to
    create a new lockspace again afterward will fail with
    "kmem_cache_create: duplicate cache dlm_conn" because the cache
    was not previously destroyed.

    Signed-off-by: David Teigland

    David Teigland
     

13 Nov, 2008

2 commits


12 Nov, 2008

1 commit

  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    [XFS] XFS: Check for valid transaction headers in recovery
    [XFS] handle memory allocation failures during log initialisation
    [XFS] Account for allocated blocks when expanding directories
    [XFS] Wait for all I/O on truncate to zero file size
    [XFS] Fix use-after-free with log and quotas

    Linus Torvalds
     

11 Nov, 2008

7 commits

  • ocfs2_xattr_block_get() calls ocfs2_xattr_search() to find an external
    xattr, but doesn't check the search result that is passed back via struct
    ocfs2_xattr_search. Add a check for search result, and pass back -ENODATA if
    the xattr search failed. This avoids a later NULL pointer error.

    Signed-off-by: Tiger Yang
    Signed-off-by: Mark Fasheh

    Tiger Yang
     
  • Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Signed-off-by: Dmitri Monakhov
    Cc: Jeff Moyer
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Mark Fasheh

    Dmitri Monakhov
     
  • In ocfs2/xattr, we must make sure the xattrs which have the same hash value
    exist in the same bucket so that the search schema can work. But in the old
    implementation, when we want to extend a bucket, we just move half number of
    xattrs to the new bucket. This works in most cases, but if we are lucky
    enough we will move 2 xattrs into 2 different buckets. This means that an
    xattr from the previous bucket cannot be found anymore. This patch fix this
    problem by finding the right position during extending the bucket and extend
    an empty bucket if needed.

    Signed-off-by: Tao Ma
    Cc: Joel Becker
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • In ocfs2_page_mkwrite, we return -EINVAL when we found the page mapping
    isn't updated, and it will cause the user space program get SIGBUS and
    exit. The reason is that during race writeable mmap, we will do
    unmap_mapping_range in ocfs2_data_downconvert_worker. The good thing is
    that if we reuturn 0 in page_mkwrite, VFS will retry fault and then
    call page_mkwrite again, so it is safe to return 0 here.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • Patch sets journal descriptor to NULL after the journal is shutdown.
    This ensures that jbd2_journal_release_jbd_inode(), which removes the
    jbd2 inode from txn lists, can be called safely from ocfs2_clear_inode()
    even after the journal has been shutdown.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • On failure, ocfs2_start_trans() returns values like ERR_PTR(-ENOMEM),
    so we should check whether handle is NULL. Fix them to use IS_ERR().
    Jan has made the patch for other part in ocfs2(thank Jan for it), so
    this is just the fix for fs/ocfs2/xattr.c.

    Signed-off-by: Tao Ma
    Cc: Jan Kara
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Tao Ma