26 Jul, 2011

3 commits

  • Copy __generic_file_splice_read() and generic_file_splice_read() from
    fs/splice.c to shmem_file_splice_read() in mm/shmem.c. Make
    page_cache_pipe_buf_ops and spd_release_page() accessible to it.

    Signed-off-by: Hugh Dickins
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • /proc/pid/oom_adj is deprecated and scheduled for removal in August 2012
    according to Documentation/feature-removal-schedule.txt.

    This patch makes the warning more verbose by making it appear as a more
    serious problem (the presence of a stack trace and being multiline should
    attract more attention) so that applications still using the old interface
    can get fixed.

    Very popular users of the old interface have been converted since the oom
    killer rewrite has been introduced. udevd switched to the
    /proc/pid/oom_score_adj interface for v162, kde switched in 4.6.1, and
    opensshd switched in 5.7p1.

    At the start of 2012, this should be changed into a WARN() to emit all
    such incidents and then finally remove the tunable in August 2012 as
    scheduled.

    Signed-off-by: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • This:

    vma->vm_pgoff & ~(huge_page_mask(h) >> PAGE_SHIFT)

    is incorrect on 32-bit. It causes us to & the pgoff with something that
    looks like this (for a 4m hugepage): 0xfff003ff. The mask should be
    flipped and *then* shifted, to give you 0x0000_03fff.

    Signed-off-by: Becky Bruce
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Becky Bruce
     

23 Jul, 2011

17 commits

  • unlinkat - Remove a directory entry

    size[4] Tunlinkat tag[2] dirfid[4] name[s] flag[4]
    size[4] Runlinkat tag[2]

    older Tremove have the below request format

    size[4] Tremove tag[2] fid[4]

    The remove message is used to remove a directory entry either file or directory
    The remove opreation is actually a directory opertation and should ideally have
    dirfid, if not we cannot represent the fid on server with anything other than
    name. We will have to derive the directory name from fid in the Tremove request.

    NOTE: The operation doesn't clunk the unlink fid.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • renameat - change name of file or directory

    size[4] Trenameat tag[2] olddirfid[4] oldname[s] newdirfid[4] newname[s]
    size[4] Rrenameat tag[2]

    older Trename have the below request format

    size[4] Trename tag[2] fid[4] newdirfid[4] name[s]

    The rename message is used to change the name of a file, possibly moving it
    to a new directory. The rename opreation is actually a directory opertation
    and should ideally have olddirfid, if not we cannot represent the fid on server
    with anything other than name. We will have to derive the old directory name
    from fid in the Trename request.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • This make sure we don't end up reusing the unlinked inode object.
    The ideal way is to use inode i_generation. But i_generation is
    not available in userspace always.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Without this fix, if any invalid mount options/args are passed while mouting
    the 9p fs, no error (-EINVAL) is returned and default arg value is assigned.

    This fix returns -EINVAL when an invalid arguement is found while parsing
    mount options.

    Signed-off-by: Prem Karat
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Prem Karat
     
  • This make sure we don't use wrong inode from the inode hash. The inode number
    of the file deleted is reused by the next file system object created
    and if we only use inode number for inode hash lookup we could end up
    with wrong struct inode.

    Also compare inode generation number. Not all Linux file system provide
    st_gen in userspace. So it could be 0;

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Now that VFS does the right thing remove the work around.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     
  • Replace unclear (struct dentry *) to (struct file *) typecast with ERR_CAST() macro.

    Signed-off-by: Konstantin Khlebnikov
    Signed-off-by: Al Viro

    Konstantin Khlebnikov
     
  • sbi->s_mutex isn't needed for isofs at all so we can just remove it. Generally,
    since isofs is always mounted read-only, filesystem structure cannot change
    under us. So buffer_head contents stays constant after it's filled in. That
    leaves us with possible changes of global data structures. Superblock changes
    only during filesystem mount (even remount does not change it), inodes are only
    filled in during reading from disk. So there are no changes of these structures
    to bother about.

    Arguments why sbi->s_mutex can be removed at each place:
    isofs_readdir: Accesses sb, inode, filp, local variables => s_mutex not needed
    isofs_lookup: Protected by directory's i_mutex. Accesses sb, inode, dentry,
    local variables => s_mutex not needed
    rock_ridge_symlink_readpage: Protected by page lock. Accesses sb, inode,
    local variables => s_mutex not needed.

    Signed-off-by: Jan Kara
    Signed-off-by: Al Viro

    Jan Kara
     
  • We don't generate IN_DELETE_SELF on victim of overwriting rename() if
    it happens to be a directory. Trivially fixed by doing to ->i_nlink
    what we do ->pino_nlink a couple of lines later in jffs2_rename().

    Signed-off-by: Al Viro

    Al Viro
     
  • On ramfs and other simple_rename() users IN_DELETE_SELF is not generated
    for victim of overwriting rename() if it's is a directory. Works on
    most of the local filesystems and really trivial to fix...

    Signed-off-by: Al Viro

    Al Viro
     
  • * 'ptrace' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc: (39 commits)
    ptrace: do_wait(traced_leader_killed_by_mt_exec) can block forever
    ptrace: fix ptrace_signal() && STOP_DEQUEUED interaction
    connector: add an event for monitoring process tracers
    ptrace: dont send SIGSTOP on auto-attach if PT_SEIZED
    ptrace: mv send-SIGSTOP from do_fork() to ptrace_init_task()
    ptrace_init_task: initialize child->jobctl explicitly
    has_stopped_jobs: s/task_is_stopped/SIGNAL_STOP_STOPPED/
    ptrace: make former thread ID available via PTRACE_GETEVENTMSG after PTRACE_EVENT_EXEC stop
    ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/
    ptrace: kill real_parent_is_ptracer() in in favor of ptrace_reparented()
    ptrace: ptrace_reparented() should check same_thread_group()
    redefine thread_group_leader() as exit_signal >= 0
    do not change dead_task->exit_signal
    kill task_detached()
    reparent_leader: check EXIT_DEAD instead of task_detached()
    make do_notify_parent() __must_check, update the callers
    __ptrace_detach: avoid task_detached(), check do_notify_parent()
    kill tracehook_notify_death()
    make do_notify_parent() return bool
    ptrace: s/tracehook_tracer_task()/ptrace_parent()/
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs: (49 commits)
    xfs: add size update tracepoint to IO completion
    xfs: convert AIL cursors to use struct list_head
    xfs: remove confusing ail cursor wrapper
    xfs: use a cursor for bulk AIL insertion
    xfs: failure mapping nfs fh to inode should return ESTALE
    xfs: Remove the second parameter to xfs_sb_count()
    xfs: remove the dead XFS_DABUF_DEBUG code
    xfs: remove leftovers of the old btree tracing code
    xfs: remove the dead QUOTADEBUG code
    xfs: remove the unused xfs_buf_delwri_sort function
    xfs: remove wrappers around b_iodone
    xfs: remove wrappers around b_fspriv
    xfs: add a proper transaction pointer to struct xfs_buf
    xfs: factor out xfs_da_grow_inode_int
    xfs: factor out xfs_dir2_leaf_find_stale
    xfs: cleanup struct xfs_dir2_free
    xfs: reshuffle dir2 headers
    xfs: start periodic workers later
    Revert "xfs: fix filesystsem freeze race in xfs_trans_alloc"
    xfs: remove variables that serve no purpose in xfs_alloc_ag_vextent_exact()
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
    dlm: don't limit active work items
    dlm: use workqueue for callbacks
    dlm: remove deadlock debug print
    dlm: improve rsb searches
    dlm: keep lkbs in idr
    dlm: fix kmalloc args
    dlm: don't do pointless NULL check, use kzalloc and fix order of arguments
    dlm: dump address of unknown node
    dlm: use vmalloc for hash tables
    dlm: show addresses in configfs

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/hfsplus:
    hfsplus: ensure bio requests are not smaller than the hardware sectors
    hfsplus: Add additional range check to handle on-disk corruptions
    hfsplus: Add error propagation for hfsplus_ext_write_extent_locked
    hfsplus: add error checking for hfs_find_init()
    hfsplus: lift the 2TB size limit
    hfsplus: fix overflow in hfsplus_read_wrapper
    hfsplus: fix overflow in hfsplus_get_block
    hfsplus: assignments inside `if' condition clean-up

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
    GFS2: combine duplicated block freeing routines
    GFS2: Add S_NOSEC support
    GFS2: Automatically adjust glock min hold time
    GFS2: Cache dir hash table in a contiguous buffer

    Linus Torvalds
     
  • * 'linux-next' of git://git.infradead.org/ubifs-2.6: (32 commits)
    MAINTAINERS: change e-mail of Adrian Hunter
    UBIFS: fix master node recovery
    UBIFS: improve power cut emulation testing
    UBIFS: rename recovery testing variables
    UBIFS: remove custom list of superblocks
    UBIFS: stop re-defining UBI operations
    UBIFS: switch to I/O helpers
    UBIFS: switch to ubifs_leb_write
    UBIFS: switch to ubifs_leb_read
    UBIFS: introduce more I/O helpers
    UBIFS: always print stacktrace when switching to R/O mode
    UBIFS: remove unused and unneeded debugging function
    UBIFS: add global debugfs knobs
    UBIFS: introduce debugfs helpers
    UBIFS: re-arrange debugging code a bit
    UBIFS: be more informative in failure mode
    UBIFS: switch self-check knobs to debugfs
    UBIFS: lessen amount of debugging check types
    UBIFS: introduce helper functions for debugging checks and tests
    UBIFS: amend debugging inode size check function prototype
    ...

    Linus Torvalds
     

22 Jul, 2011

6 commits

  • Currently all bio requests are 512 bytes, which may fail for media
    whose physical sector size is larger than this. Ensure these
    requests are not smaller than the block device logical block size.

    BugLink: http://bugs.launchpad.net/bugs/734883
    Signed-off-by: Seth Forshee
    Signed-off-by: Christoph Hellwig

    Seth Forshee
     
  • 'recoff' is read from disk and used for an argument to memcpy, so if
    the value read from disk is larger than the page size, it result to
    "general protection fault". This patch add additional range check for
    the value, so that disk fuzz won't cause such fault.

    Signed-off-by: Naohiro Aota
    Signed-off-by: Christoph Hellwig

    Naohiro Aota
     
  • Test-case:

    void *tfunc(void *arg)
    {
    execvp("true", NULL);
    return NULL;
    }

    int main(void)
    {
    int pid;

    if (fork()) {
    pthread_t t;

    kill(getpid(), SIGSTOP);

    pthread_create(&t, NULL, tfunc, NULL);

    for (;;)
    pause();
    }

    pid = getppid();
    assert(ptrace(PTRACE_ATTACH, pid, 0,0) == 0);

    while (wait(NULL) > 0)
    ptrace(PTRACE_CONT, pid, 0,0);

    return 0;
    }

    It is racy, exit_notify() does __wake_up_parent() too. But in the
    likely case it triggers the problem: de_thread() does release_task()
    and the old leader goes away without the notification, the tracer
    sleeps in do_wait() without children/tracees.

    Change de_thread() to do __wake_up_parent(traced_leader->parent).
    Since it is already EXIT_DEAD we can do this without ptrace_unlink(),
    EXIT_DEAD threads do not exist from do_wait's pov.

    Signed-off-by: Oleg Nesterov
    Acked-by: Tejun Heo

    Oleg Nesterov
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    CIFS: Fix wrong length in cifs_iovec_read

    Linus Torvalds
     
  • It seems to hurt performance in real life. Yes, the inode will be used
    later, but the conditional doesn't seem to predict all that well
    (negative dentries are not uncommon) and it looks like the cost of
    prefetching is simply higher than depending on the cache doing the right
    thing.

    As usual.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • The compiler, at least for ix86 and m68k, validly warns that the
    comparison:

    next
    Reported-by: Jan Beulich
    Signed-off-by: Jan Beulich
    Signed-off-by: David Howells
    Cc: Suresh Jayaraman
    Cc: Geert Uytterhoeven
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Jan Beulich
     

21 Jul, 2011

14 commits