01 Nov, 2010

1 commit

  • …rnel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix up irq_node() for irq_data changes.
    genirq: Add single IRQ reservation helper
    genirq: Warn if enable_irq is called before irq is set up

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    semaphore: Remove mutex emulation
    staging: Final semaphore cleanup
    jbd2: Convert jbd2_slab_create_sem to mutex
    hpfs: Convert sbi->hpfs_creation_de to mutex

    Fix up trivial change/delete conflicts with deleted 'dream' drivers
    (drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})

    Linus Torvalds
     

31 Oct, 2010

9 commits

  • This one was only used for a nasty hack in nfsd, which has recently
    been removed.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • The caller allocated it, the caller should free it.

    The only issue so far is that we could change the flp pointer even on an
    error return if the fl_change callback failed. But we can simply move
    the flp assignment after the fl_change invocation, as the callers don't
    care about the flp return value if the setlease call failed.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • The NFSv4 server was initializing the dp->dl_flock pointer by the
    somewhat ridiculous method of a locks_copy_lock callback.

    Now that setlease uses the passed-in lock instead of doing a copy,
    dl_flock no longer gets set, resulting in the lock leaking on delegation
    release, and later possible hangs (among other problems).

    So, initialize dl_flock and get rid of the callback.

    Signed-off-by: J. Bruce Fields
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • We modified setlease to require the caller to allocate the new lease in
    the case of creating a new lease, but forgot to fix up the filesystem
    methods.

    Cc: Steven Whitehouse
    Cc: Steve French
    Cc: Trond Myklebust
    Signed-off-by: J. Bruce Fields
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • We're depending on setlease to free the passed-in lease on failure.

    Signed-off-by: J. Bruce Fields
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • Removing a lock shouldn't require any allocations; a failure due to
    ENOMEM leaves the caller with a choice between retrying or giving up and
    leaking an unused lease.

    Next we should split the other lease calls into add and delete cases.
    I wanted to start with just the bugfix.

    Signed-off-by: J. Bruce Fields
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • * 'for-linus' of git://git.infradead.org/users/eparis/notify: (22 commits)
    Ensure FMODE_NONOTIFY is not set by userspace
    make fanotify_read() restartable across signals
    fsnotify: remove alignment padding from fsnotify_mark on 64 bit builds
    fs/notify/fanotify/fanotify_user.c: fix warnings
    fanotify: Fix FAN_CLOSE comments
    fanotify: do not recalculate the mask if the ignored mask changed
    fanotify: ignore events on directories unless specifically requested
    fsnotify: rename FS_IN_ISDIR to FS_ISDIR
    fanotify: do not send events for irregular files
    fanotify: limit number of listeners per user
    fanotify: allow userspace to override max marks
    fanotify: limit the number of marks in a single fanotify group
    fanotify: allow userspace to override max queue depth
    fsnotify: implement a default maximum queue depth
    fanotify: ignore fanotify ignore marks if open writers
    fanotify: allow userspace to flush all marks
    fsnotify: call fsnotify_parent in perm events
    fsnotify: correctly handle return codes from listeners
    fanotify: use __aligned_u64 in fanotify userspace metadata
    fanotify: implement fanotify listener ordering
    ...

    Linus Torvalds
     
  • In fanotify_read() return -ERESTARTSYS instead of -EINTR to
    make read() restartable across signals (BSD semantic).

    Signed-off-by: Eric Paris

    Lino Sanfilippo
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (39 commits)
    Btrfs: deal with errors from updating the tree log
    Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed
    Btrfs: make SNAP_DESTROY async
    Btrfs: add SNAP_CREATE_ASYNC ioctl
    Btrfs: add START_SYNC, WAIT_SYNC ioctls
    Btrfs: async transaction commit
    Btrfs: fix deadlock in btrfs_commit_transaction
    Btrfs: fix lockdep warning on clone ioctl
    Btrfs: fix clone ioctl where range is adjacent to extent
    Btrfs: fix delalloc checks in clone ioctl
    Btrfs: drop unused variable in block_alloc_rsv
    Btrfs: cleanup warnings from gcc 4.6 (nonbugs)
    Btrfs: Fix variables set but not read (bugs found by gcc 4.6)
    Btrfs: Use ERR_CAST helpers
    Btrfs: use memdup_user helpers
    Btrfs: fix raid code for removing missing drives
    Btrfs: Switch the extent buffer rbtree into a radix tree
    Btrfs: restructure try_release_extent_buffer()
    Btrfs: use the flusher threads for delalloc throttling
    Btrfs: tune the chunk allocation to 5% of the FS as metadata
    ...

    Fix up trivial conflicts in fs/btrfs/super.c and fs/fs-writeback.c, and
    remove use of INIT_RCU_HEAD in fs/btrfs/extent_io.c (that init macro was
    useless and removed in commit 5e8067adfdba: "rcu head remove init")

    Linus Torvalds
     

30 Oct, 2010

24 commits

  • The btrfs merge looks like hell, because it changes fs-writeback.c, and
    the crazy code has this repeated "estimate number of dirty pages"
    counting that involves three different helper functions. And it's done
    in two different places.

    Just unify that whole calculation as a "get_nr_dirty_pages()" helper
    function, and the merge result will look half-way decent.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * git://git.infradead.org/mtd-2.6: (82 commits)
    mtd: fix build error in m25p80.c
    mtd: Remove redundant mutex from mtd_blkdevs.c
    MTD: Fix wrong check register_blkdev return value
    Revert "mtd: cleanup Kconfig dependencies"
    mtd: cfi_cmdset_0002: make sector erase command variable
    mtd: cfi_cmdset_0002: add CFI detection for SST 38VF640x chips
    mtd: cfi_util: add support for switching SST 39VF640xB chips into QRY mode
    mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of hardcoded one
    block2mtd: dubious assignment
    P4080/mtd: Fix the freescale lbc issue with 36bit mode
    P4080/eLBC: Make Freescale elbc interrupt common to elbc devices
    mtd: phram: use KBUILD_MODNAME
    mtd: OneNAND: S5PC110: Fix double call suspend & resume function
    mtd: nand: fix MTD_MODE_RAW writes
    jffs2: use kmemdup
    mtd: sm_ftl: cosmetic, use bool when possible
    mtd: r852: remove useless pci powerup/down from suspend/resume routines
    mtd: blktrans: fix a race vs kthread_stop
    mtd: blktrans: kill BKL
    mtd: allow to unload the mtdtrans module if its block devices aren't open
    ...

    Fix up trivial whitespace-introduced conflict in drivers/mtd/mtdchar.c

    Linus Torvalds
     
  • The definition of PAGE_CACHE_MASK in is needed to use
    MAX_RW_COUNT, and on x86-64 that gets done indirectly through the
    architecture header includes. But on MIPS and s390 that doesn't happen,
    and we need to make sure that fs/compat.c includes pagemap.h explicitly.

    Introduced in commit 435f49a518c7 ("readv/writev: do the same
    MAX_RW_COUNT truncation that read/write does").

    Reported-by: Sachin Sant (S390)
    Reported-by: wu zhangjin (MIPS)
    Signed-off-by: Linus Torvalds

    wu zhangjin
     
  • Conflicts:
    drivers/mtd/mtd_blkdevs.c

    Merge Grant's device-tree bits so that we can apply the subsequent fixes.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • During unlink we remove any references to the inode from
    the tree log. It can return -ENOENT and other errors,
    and this changes the unlink code to deal with it.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • jbd2_slab_create_sem is used as a mutex, so make it one.

    [ akpm muttered: We may as well make it local to
    jbd2_journal_create_slab() also. ]

    Signed-off-by: Thomas Gleixner
    Cc: Ted Ts'o
    Cc: Andrew Morton
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • sbi->hpfs_creation_de is used as mutex so make it a mutex.

    Signed-off-by: Thomas Gleixner
    Acked-by: Christoph Hellwig
    Cc: Peter Zijlstra
    Cc: Al Viro
    Cc: linux-fsdevel@vger.kernel.org
    LKML-Reference:

    Thomas Gleixner
     
  • Add a mount option user_subvol_rm_allowed that allows users to delete a
    (potentially non-empty!) subvol when they would otherwise we allowed to do
    an rmdir(2). We duplicate the may_delete() checks from the core VFS code
    to implement identical security checks (minus the directory size check).
    We additionally require that the user has write+exec permission on the
    subvol root inode.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • There is no reason to force an immediate commit when deleting a snapshot.
    Users have some expectation that space from a deleted snapshot be freed
    immediately, but even if we do commit the reclaim is a background process.

    If users _do_ want the deletion to be durable, they can call 'sync'.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • Create a snap without waiting for it to commit to disk. The ioctl is
    ordered such that subsequent operations will not be contained by the
    created snapshot, and the commit is initiated, but the ioctl does not
    wait for the snapshot to commit to disk.

    We return the specific transid to userspace so that an application can wait
    for this specific snapshot creation to commit via the WAIT_SYNC ioctl.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6:
    eCryptfs: Print mount_auth_tok_only param in ecryptfs_show_options
    ecryptfs: added ecryptfs_mount_auth_tok_only mount parameter
    ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig()
    ecryptfs: release keys loaded in ecryptfs_keyring_auth_tok_for_sig()
    eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
    ecryptfs: call vfs_setxattr() in ecryptfs_setxattr()

    Linus Torvalds
     
  • START_SYNC will start a sync/commit, but not wait for it to
    complete. Any modification started after the ioctl returns is
    guaranteed not to be included in the commit. If a non-NULL
    pointer is passed, the transaction id will be returned to
    userspace.

    WAIT_SYNC will wait for any in-progress commit to complete. If a
    transaction id is specified, the ioctl will block and then
    return (success) when the specified transaction has committed.
    If it has already committed when we call the ioctl, it returns
    immediately. If the specified transaction doesn't exist, it
    returns EINVAL.

    If no transaction id is specified, WAIT_SYNC will wait for the
    currently committing transaction to finish it's commit to disk.
    If there is no currently committing transaction, it returns
    success.

    These ioctls are useful for applications which want to impose an
    ordering on when fs modifications reach disk, but do not want to
    wait for the full (slow) commit process to do so.

    Picky callers can take the transid returned by START_SYNC and
    feed it to WAIT_SYNC, and be certain to wait only as long as
    necessary for the transaction _they_ started to reach disk.

    Sloppy callers can START_SYNC and WAIT_SYNC without a transid,
    and provided they didn't wait too long between the calls, they
    will get the same result. However, if a second commit starts
    before they call WAIT_SYNC, they may end up waiting longer for
    it to commit as well. Even so, a START_SYNC+WAIT_SYNC still
    guarantees that any operation completed before the START_SYNC
    reaches disk.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • Add support for an async transaction commit that is ordered such that any
    subsequent operations will join the following transaction, but does not
    wait until the current commit is fully on disk. This avoids much of the
    latency associated with the btrfs_commit_transaction for callers concerned
    with serialization and not safety.

    The wait_for_unblock flag controls whether we wait for the 'middle' portion
    of commit_transaction to complete, which is necessary if the caller expects
    some of the modifications contained in the commit to be available (this is
    the case for subvol/snapshot creation).

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • We calculate timeout (either 1 or MAX_SCHEDULE_TIMEOUT) based on whether
    num_writers > 1 or should_grow at the top of the loop. Then, much much
    later, we wait for that timeout if either num_writers or should_grow is
    true. However, it's possible for a racing process (calling
    btrfs_end_transaction()) to decrement num_writers such that we wait
    forever instead of for 1.

    Fix this by deciding how long to wait when we wait. Include a smp_mb()
    before checking if the waitqueue is active to ensure the num_writers
    is visible.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • I'm no lockdep expert, but this appears to make the lockdep warning go
    away for the i_mutex locking in the clone ioctl.

    Signed-off-by: Sage Weil
    Signed-off-by: Chris Mason

    Sage Weil
     
  • We had an edge case issue where the requested range was just
    following an existing extent. Instead of skipping to the next
    extent, we used the previous one which lead to having zero
    sized extents.

    Signed-off-by: Yehuda Sadeh
    Signed-off-by: Chris Mason

    Sage Weil
     
  • The lookup_first_ordered_extent() was done on the wrong inode, and the
    ->delalloc_bytes test was wrong, as the following
    btrfs_wait_ordered_range() would only invoke a range write and wouldn't
    write the entire file data range. Also, a bad parameter was passed to
    btrfs_wait_ordered_range().

    Signed-off-by: Yehuda Sadeh
    Signed-off-by: Chris Mason

    Sage Weil
     
  • The alloc_target variable is not really used.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • These are all the cases where a variable is set, but not read which are
    not bugs as far as I can see, but simply leftovers.

    Still needs more review.

    Found by gcc 4.6's new warnings

    Signed-off-by: Andi Kleen
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Chris Mason

    Andi Kleen
     
  • These are all the cases where a variable is set, but not
    read which are really bugs.

    - Couple of incorrect error handling fixed.
    - One incorrect use of a allocation policy
    - Some other things

    Still needs more review.

    Found by gcc 4.6's new warnings.

    [akpm@linux-foundation.org: fix build. Might have been bitrot]
    Signed-off-by: Andi Kleen
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Chris Mason

    Andi Kleen
     
  • Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
    clear what is the purpose of the operation, which otherwise looks like a
    no-op.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T x;
    identifier f;
    @@

    T f (...) { }

    @@
    expression x;
    @@

    - ERR_PTR(PTR_ERR(x))
    + ERR_CAST(x)
    //

    Signed-off-by: Julia Lawall
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Chris Mason

    Julia Lawall
     
  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Chris Mason

    Julia Lawall
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: Cleanup and thus reduce smb session structure and fields used during authentication
    NTLM auth and sign - Use appropriate server challenge
    cifs: add kfree() on error path
    NTLM auth and sign - minor error corrections and cleanup
    NTLM auth and sign - Use kernel crypto apis to calculate hashes and smb signatures
    NTLM auth and sign - Define crypto hash functions and create and send keys needed for key exchange
    cifs: cifs_convert_address() returns zero on error
    NTLM auth and sign - Allocate session key/client response dynamically
    cifs: update comments - [s/GlobalSMBSesLock/cifs_file_list_lock/g]
    cifs: eliminate cifsInodeInfo->write_behind_rc (try #6)
    [CIFS] Fix checkpatch warnings and bump cifs version number
    cifs: wait for writeback to complete in cifs_flush
    cifs: convert cifsFileInfo->count to non-atomic counter

    Linus Torvalds
     
  • We used to protect against overflow, but rather than return an error, do
    what read/write does, namely to limit the total size to MAX_RW_COUNT.
    This is not only more consistent, but it also means that any broken
    low-level read/write routine that still keeps counts in 'int' can't
    break.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

29 Oct, 2010

6 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
    Squashfs: fix function prototype
    Squashfs: fix use of __le64 annotated variable

    Linus Torvalds
     
  • When printing mount options, print the new ecryptfs_mount_auth_tok_only
    mount option.

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • This patch adds a new mount parameter 'ecryptfs_mount_auth_tok_only' to
    force ecryptfs to use only authentication tokens which signature has
    been specified at mount time with parameters 'ecryptfs_sig' and
    'ecryptfs_fnek_sig'. In this way, after disabling the passthrough and
    the encrypted view modes, it's possible to make available to users only
    files encrypted with the specified authentication token.

    Signed-off-by: Roberto Sassu
    Cc: Dustin Kirkland
    Cc: James Morris
    [Tyler: Clean up coding style errors found by checkpatch]
    Signed-off-by: Tyler Hicks

    Roberto Sassu
     
  • This patch replaces the check of the 'matching_auth_tok' pointer with
    the exit status of ecryptfs_find_auth_tok_for_sig().
    This avoids to use authentication tokens obtained through the function
    ecryptfs_keyring_auth_tok_for_sig which are not valid.

    Signed-off-by: Roberto Sassu
    Cc: Dustin Kirkland
    Cc: James Morris
    Signed-off-by: Tyler Hicks

    Roberto Sassu
     
  • This patch allows keys requested in the function
    ecryptfs_keyring_auth_tok_for_sig()to be released when they are no
    longer required. In particular keys are directly released in the same
    function if the obtained authentication token is not valid.

    Further, a new function parameter 'auth_tok_key' has been added to
    ecryptfs_find_auth_tok_for_sig() in order to provide callers the key
    pointer to be passed to key_put().

    Signed-off-by: Roberto Sassu
    Cc: Dustin Kirkland
    Cc: James Morris
    [Tyler: Initialize auth_tok_key to NULL in ecryptfs_parse_packet_set]
    Signed-off-by: Tyler Hicks

    Roberto Sassu
     
  • eCryptfs was passing the LOOKUP_OPEN flag through to the lower file
    system, even though ecryptfs_create() doesn't support the flag. A valid
    filp for the lower filesystem could be returned in the nameidata if the
    lower file system's create() function supported LOOKUP_OPEN, possibly
    resulting in unencrypted writes to the lower file.

    However, this is only a potential problem in filesystems (FUSE, NFS,
    CIFS, CEPH, 9p) that eCryptfs isn't known to support today.

    https://bugs.launchpad.net/ecryptfs/+bug/641703

    Reported-by: Kevin Buhr
    Cc: stable
    Signed-off-by: Tyler Hicks

    Tyler Hicks