24 Aug, 2007

3 commits


23 Aug, 2007

8 commits

  • This patch removes the v9fs_fid_lookup_remove which is no longer used.

    Based on original patch from Adrian Bunk which
    used #if 0 to isolate the code.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • Fix the accounting regression for CONFIG_VIRT_CPU_ACCOUNTING. It
    reverts parts of commit b27f03d4bdc145a09fb7b0c0e004b29f1ee555fa by
    converting fs/proc/array.c back to cputime_t. The new functions
    task_utime and task_stime now return cputime_t instead of clock_t. If
    CONFIG_VIRT_CPU_ACCOUTING is set, task->utime and task->stime are
    returned directly instead of using sum_exec_runtime.

    Patch is tested on s390x with and without VIRT_CPU_ACCOUTING as well as
    on i386.

    [ mingo@elte.hu: cleanups, comments. ]

    Signed-off-by: Christian Borntraeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Christian Borntraeger
     
  • de_thread:

    if (atomic_read(&oldsighand->count) count) != 1);

    This is not safe without the rmb() in between. The results of two
    correctly ordered __exit_signal()->atomic_dec_and_test()'s could be seen
    out of order on our CPU.

    The same is true for the "thread_group_empty()" case, __unhash_process()'s
    changes could be seen before atomic_dec_and_test(&sig->count).

    On some platforms (including i386) atomic_read() doesn't provide even the
    compiler barrier, in that case these checks are simply racy.

    Remove these BUG_ON()'s. Alternatively, we can do something like

    BUG_ON( ({ smp_rmb(); atomic_read(&sig->count) != 1; }) );

    Signed-off-by: Oleg Nesterov
    Acked-by: Paul E. McKenney
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Due to inconsistent locking in the VFS between calls to lookup and
    revalidate deadlock can occur in the automounter.

    The inconsistency is that the directory inode mutex is held for both lookup
    and revalidate calls when called via lookup_hash whereas it is held only
    for lookup during a path walk. Consequently, if the mutex is held during a
    call to revalidate autofs4 can't release the mutex to callback the daemon
    as it can't know whether it owns the mutex.

    This situation happens when a process tries to create a directory within an
    automount and a second process also tries to create the same directory
    between the lookup and the mkdir. Since the first process has dropped the
    mutex for the daemon callback, the second process takes it during
    revalidate leading to deadlock between the autofs daemon and the second
    process when the daemon tries to create the mount point directory.

    After spending quite a bit of time trying to resolve this on more than one
    occassion, using rather complex and ulgy approaches, it turns out that just
    delaying the hashing of the dentry until the create operation works fine.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • With this patch any thread can dequeue its own private signals via signalfd,
    even if it was created by another sub-thread.

    To do so, we pass "current" to dequeue_signal() if the caller is from the same
    thread group. This also fixes the scheduling of posix timers broken by the
    previous patch.

    If the caller doesn't belong to this thread group, we can't handle __SI_TIMER
    case properly anyway. Perhaps we should forbid the cross-process signalfd usage
    and convert ctx->tsk to ctx->sighand.

    Signed-off-by: Oleg Nesterov
    Cc: Benjamin Herrenschmidt
    Cc: Davide Libenzi
    Cc: Ingo Molnar
    Cc: Michael Kerrisk
    Cc: Roland McGrath
    Cc: Thomas Gleixner
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • When ecryptfs_lookup() is called against special files, eCryptfs generates
    the following errors because it tries to treat them like regular eCryptfs
    files.

    Error opening lower file for lower_dentry [0xffff810233a6f150], lower_mnt [0xffff810235bb4c80], and flags [0x8000]
    Error opening lower_file to read header region
    Error attempting to read the [user.ecryptfs] xattr from the lower file; return value = [-95]
    Valid metadata not found in header region or xattr region; treating file as unencrypted

    For instance, the problem can be reproduced by the steps below.

    # mkdir /root/crypt /mnt/crypt
    # mount -t ecryptfs /root/crypt /mnt/crypt
    # mknod /mnt/crypt/c0 c 0 0
    # umount /mnt/crypt
    # mount -t ecryptfs /root/crypt /mnt/crypt
    # ls -l /mnt/crypt

    This patch fixes it by adding a check similar to directories and
    symlinks.

    Signed-off-by: Ryusuke Konishi
    Acked-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This patch (as960) removes the error message and stack dump logged by
    sysfs_remove_bin_file() when someone tries to remove a nonexistent
    file. The warning doesn't seem to be needed, since none of the other
    file-, symlink-, or directory-removal routines in sysfs complain in a
    comparable way.

    Signed-off-by: Alan Stern
    Acked-by: Tejun Heo
    Acked-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • sd children list walking in sysfs_lookup() and sd renaming in
    sysfs_rename_dir() were left out during i_mutex -> sysfs_mutex
    conversion. Fix them.

    Signed-off-by: Tejun Heo
    Acked-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

21 Aug, 2007

2 commits

  • This patch uses kzalloc to zero all of struct dio rather than manually
    trying to track which fields we rely on being zero. It passed aio+dio
    stress testing and some bug regression testing on ext3.

    This patch was introduced by Linus in the conversation that lead up to
    Badari's minimal fix to manually zero .map_bh.b_state in commit:

    6a648fa72161d1f6468dabd96c5d3c0db04f598a

    It makes the code a bit smaller. Maybe a couple fewer cachelines to
    load, if we're lucky:

    text data bss dec hex filename
    3285925 568506 1304616 5159047 4eb887 vmlinux
    3285797 568506 1304616 5158919 4eb807 vmlinux.patched

    I was unable to measure a stable difference in the number of cpu cycles
    spent in blockdev_direct_IO() when pushing aio+dio 256K reads at
    ~340MB/s.

    So the resulting intent of the patch isn't a performance gain but to
    avoid exposing ourselves to the risk of finding another field like
    .map_bh.b_state where we rely on zeroing but don't enforce it in the
    code.

    Signed-off-by: Zach Brown
    Signed-off-by: Linus Torvalds

    Zach Brown
     
  • Commit a491486a2087ac3dfc00efb4f838c8d684afaf54 introduced a locking
    problem in JFFS2 -- we up() the alloc_sem when we weren't previously
    holding it. This leads to all kinds of fun behaviour later.

    There was a _reason_ for the
    if (1 /* alternative path needs testing */ ||
    which the above-mentioned commit removed :)

    Discovered and debugged by Giulio Fedel

    Signed-off-by: David Woodhouse
    Signed-off-by: Linus Torvalds

    David Woodhouse
     

19 Aug, 2007

2 commits


18 Aug, 2007

1 commit


14 Aug, 2007

12 commits

  • This reverts commit 569a7b6c2e8965ff4908003b925757703a3d649c. The
    code was correct originally. The default setting for ACLs after a
    remount should be to be the same as before the remount.

    Signed-off-by: Abhijith Das
    Signed-off-by: Steven Whitehouse

    Steven Whitehouse
     
  • Due to a mix up between the jdata attribute and inherit jdata attribute
    it has not been possible to set the inherit jdata attribute on
    directories. This is now fixed and the ioctl will report the inherit
    jdata attribute for directories rather than the jdata attribute as it
    did previously. This stems from our need to have the one bit in the
    ioctl attr flags mean two different things according to whether the
    underlying inode is a directory or not.

    Signed-off-by: Steven Whitehouse

    Steven Whitehouse
     
  • The error path in prepare_write() was incorrect in the (very rare) event
    that the transaction fails to start. The following prevents a NULL
    pointer dereference,

    Signed-off-by: Steven Whitehouse

    Steven Whitehouse
     
  • The following patch fixes a bug where 0 was being used as a return code
    to indicate "nothing to do" when in fact 0 was a valid block location
    which might be returned by the function.

    Signed-off-by: Steven Whitehouse

    Steven Whitehouse
     
  • This patch seems to fix the problem described in bugzilla bug 246114.
    It was written by Steve Whitehouse with some tweaking by me.

    The code was looping in the relatively new section of code designed to
    search for and reuse unlinked inodes. In cases where it was finding an
    appropriate inode to reuse, it was looping around and finding the same
    block over and over because a "
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • This is part 2 of the patch for bug #245832, part 1 of which is already
    in the git tree.

    The problem was that sdp->sd_log_num_databuf was not always being
    protected by the gfs2_log_lock spinlock, but the sd_log_le_databuf
    (which it is supposed to reflect) was protected. That meant there
    was a timing window during which gfs2_log_flush called
    databuf_lo_before_commit and the count didn't match what was
    really on the linked list in that window. So when it ran out of
    items on the linked list, it decremented total_dbuf from 0 to -1 and
    thus never left the "while(total_dbuf)" loop.

    The solution is to protect the variable sdp->sd_log_num_databuf so
    that the value will always match the contents of the linked list,
    and therefore the number will never go negative, and therefore, the
    loop will be exited properly.

    Signed-off-by: Bob Peterson
    Signed-off-by: Steven Whitehouse

    Bob Peterson
     
  • Fix a long standing bug where a blocking callback would be missed
    when there's a granted lock in PR mode and waiting locks in both
    PR and CW modes (and the PR lock was added to the waiting queue
    before the CW lock). The logic simply compared the numerical values
    of the modes to determine if a blocking callback was required, but in
    the one case of PR and CW, the lower valued CW mode blocks the higher
    valued PR mode. We just need to add a special check for this PR/CW
    case in the tests that decide when a blocking callback is needed.

    Signed-off-by: David Teigland
    Signed-off-by: Steven Whitehouse

    David Teigland
     
  • The last patch to clean out 'othercon' structures only fixed half the problem.
    The attached addresses the other situations too, and fixes bz#238490

    Signed-Off-By: Patrick Caulfield
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     
  • There's a memory leak in fs/dlm/member.c::dlm_add_member().

    If "dlm_node_weight(ls->ls_name, nodeid)" returns < 0, then
    we'll return without freeing the memory allocated to the (at
    that point yet unused) 'memb'.
    This patch frees the allocated memory in that case and thus
    avoids the leak.

    Signed-off-by: Jesper Juhl
    Signed-off-by: David Teigland
    Signed-off-by: Steven Whitehouse

    Jesper Juhl
     
  • When we build a sockaddr_storage for an IP address, clear the unused parts as
    they could be used for node comparisons.

    I have seen this occasionally make sctp connections fail.

    Signed-Off-By: Patrick Caulfield
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     
  • Fix regression in recent patch "[DLM] variable allocation" which
    attempts to dereference an "ls" struct when it's NULL.

    Signed-off-by: David Teigland
    Signed-off-by: Steven Whitehouse

    David Teigland
     
  • This patch clears the othercon pointer and frees the memory when a connnection
    is closed. This could cause a small memory leak when nodes leave the cluster.

    Signed-Off-By: Patrick Caulfield
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     

12 Aug, 2007

4 commits

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
    ocfs2: set non-default s_time_gran during mount
    ocfs2: Retry sendpage() if it returns EAGAIN
    ocfs2: Fix rename/extend race
    [2.6 patch] ocfs2_insert_extent(): remove dead code
    ocfs2: Fix max offset calculations
    ocfs2: check ia_size limits in setattr
    ocfs2: Fix some casting errors related to file writes
    ocfs2: use s_maxbytes directly in ocfs2_change_file_space()
    ocfs2: Restrict inode changes in ocfs2_update_inode_atime()

    Linus Torvalds
     
  • ecryptfs_init() exits without doing any cleanup jobs if
    ecryptfs_init_messaging() fails. In that case, eCryptfs leaves
    sysfs entries, leaks memory, and causes an invalid page fault.
    This patch fixes the problem.

    Signed-off-by: Ryusuke Konishi
    Acked-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • When ecryptfs_lookup() is called against special files, eCryptfs generates
    the following errors because it tries to treat them like regular eCryptfs
    files.

    Error opening lower file for lower_dentry [0xffff810233a6f150], lower_mnt [0xffff810235bb4c80], and flags
    [0x8000]
    Error opening lower_file to read header region
    Error attempting to read the [user.ecryptfs] xattr from the lower file; return value = [-95]
    Valid metadata not found in header region or xattr region; treating file as unencrypted

    For instance, the problem can be reproduced by the steps below.

    # mkdir /root/crypt /mnt/crypt
    # mount -t ecryptfs /root/crypt /mnt/crypt
    # mknod /mnt/crypt/c0 c 0 0
    # umount /mnt/crypt
    # mount -t ecryptfs /root/crypt /mnt/crypt
    # ls -l /mnt/crypt

    This patch fixes it by adding a check similar to directories and
    symlinks.

    Signed-off-by: Ryusuke Konishi
    Acked-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Need to initialize map_bh.b_state to zero. Otherwise, in case of a faulty
    user-buffer its possible to go into dio_zero_block() and submit a page by
    mistake - since it checks for buffer_new().

    http://marc.info/?l=linux-kernel&m=118551339032528&w=2

    akpm: Linus had a (better) patch to just do a kzalloc() in there, but it got
    lost. Probably this version is better for -stable anwyay.

    Signed-off-by: Badari Pulavarty
    Acked-by: Joe Jin
    Acked-by: Zach Brown
    Cc: gurudas pai
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     

10 Aug, 2007

8 commits