29 Jun, 2007

3 commits

  • When one llseek's past the end of the file and then writes, every page past
    the previous end of the file should be cleared. Trevor found that the code,
    as is, does not assure that the very last page is always cleared. This patch
    takes care of that.

    Signed-off-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • Recent changes in eCryptfs have made it possible to get to ecryptfs_setattr()
    with an uninitialized crypt_stat struct. This results in a wide and colorful
    variety of unpleasantries. This patch properly initializes the crypt_stat
    structure in ecryptfs_setattr() when it is necessary to do so.

    Signed-off-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • This patch fixes the processes involved in wiping regions of the data during
    truncate and write events, fixing a kernel hang in 2.6.22-rc4 while assuring
    that zero values are written out to the appropriate locations during events in
    which the i_size will change.

    The range passed to ecryptfs_truncate() from ecryptfs_prepare_write() includes
    the page that is the object of ecryptfs_prepare_write(). This leads to a
    kernel hang as read_cache_page() is executed on the same page in the
    ecryptfs_truncate() execution path. This patch remedies this by limiting the
    range passed to ecryptfs_truncate() so as to exclude the page that is the
    object of ecryptfs_prepare_write(); it also adds code to
    ecryptfs_prepare_write() to zero out the region of its own page when writing
    past the i_size position. This patch also modifies ecryptfs_truncate() so
    that when a file is truncated to a smaller size, eCryptfs will zero out the
    contents of the new last page from the new size through to the end of the last
    page.

    Signed-off-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     

24 Jun, 2007

3 commits


19 Jun, 2007

1 commit


17 Jun, 2007

3 commits

  • Some user space tools need to identify SYSV shared memory when examining
    /proc//maps. To do so they look for a block device with major zero, a
    dentry named SYSV, and having the minor of the internal sysv
    shared memory kernel mount.

    To help these tools and to make it easier for people just browsing
    /proc//maps this patch modifies hugetlb sysv shared memory to use the
    SYSV dentry naming convention.

    User space tools will still have to be aware that hugetlb sysv shared
    memory lives on a different internal kernel mount and so has a different
    block device minor number from the rest of sysv shared memory.

    Signed-off-by: Eric W. Biederman
    Cc: "Serge E. Hallyn"
    Cc: Albert Cahalan
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • We have to take care that when we call udf_discard_prealloc() from
    udf_clear_inode() we have to write inode ourselves afterwards (otherwise,
    some changes might be lost leading to leakage of blocks, use of free blocks
    or improperly aligned extents).

    Also udf_discard_prealloc() does two different things - it removes
    preallocated blocks and truncates the last extent to exactly match i_size.
    We move the latter functionality to udf_truncate_tail_extent(), call
    udf_discard_prealloc() when last reference to a file is dropped and call
    udf_truncate_tail_extent() when inode is being removed from inode cache
    (udf_clear_inode() call).

    We cannot call udf_truncate_tail_extent() earlier as subsequent open+write
    would find the last block of the file mapped and happily write to the end
    of it, although the last extent says it's shorter.

    [akpm@linux-foundation.org: Make checkpatch.pl happier]
    Signed-off-by: Jan Kara
    Cc: Eric Sandeen
    Cc: Cyrill Gorcunov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • fs/fuse/inode.c:658:3: error: Initializer entry defined twice
    fs/fuse/inode.c:661:3: also defined here

    Signed-off-by: Alexey Dobriyan
    Acked-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

15 Jun, 2007

3 commits


13 Jun, 2007

3 commits

  • Allowing attribute and symlink dentries to be reclaimed means
    sd->s_dentry can change dynamically. However, updates to the field
    are unsynchronized leading to race conditions. This patch adds
    sysfs_lock and use it to synchronize updates to sd->s_dentry.

    Due to the locking around ->d_iput, the check in sysfs_drop_dentry()
    is complex. sysfs_lock only protect sd->s_dentry pointer itself. The
    validity of the dentry is protected by dcache_lock, so whether dentry
    is alive or not can only be tested while holding both locks.

    This is minimal backport of sysfs_drop_dentry() rewrite in devel
    branch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • The condition check doesn't make much sense as it basically always
    succeeds. This causes NULL dereferencing on certain cases. It seems
    that parentheses are put in the wrong place. Fix it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Backport of
    ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc1/2.6.22-rc1-mm1/broken-out/gregkh-driver-sysfs-allocate-inode-number-using-ida.patch

    For regular files in sysfs, sysfs_readdir wants to traverse
    sysfs_dirent->s_dentry->d_inode->i_ino to get to the inode number.
    But, the dentry can be reclaimed under memory pressure, and there is
    no synchronization with readdir. This patch follows Tejun's scheme of
    allocating and storing an inode number in the new s_ino member of a
    sysfs_dirent, when dirents are created, and retrieving it from there
    for readdir, so that the pointer chain doesn't have to be traversed.

    Tejun's upstream patch uses a new-ish "ida" allocator which brings
    along some extra complexity; this -stable patch has a brain-dead
    incrementing counter which does not guarantee uniqueness, but because
    sysfs doesn't hash inodes as iunique expects, uniqueness wasn't
    guaranteed today anyway.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric Sandeen
     

12 Jun, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    [CIFS] CIFS should honour umask
    [CIFS] Missing flag on negprot needed for some servers to force packet signing
    [CIFS] whitespace cleanup part 2
    [CIFS] whitespace cleanup
    [CIFS] fix mempool destroy done in wrong order in cifs error path
    [CIFS] typo in previous patch
    [CIFS] Fix oops on failed cifs mount (in kthread_stop)

    Linus Torvalds
     
  • * 'splice-2.6.22' of git://git.kernel.dk/data/git/linux-2.6-block:
    splice: __generic_file_splice_read: fix read/truncate race
    splice: __generic_file_splice_read: fix i_size_read() length checks
    splice: move balance_dirty_pages_ratelimited() outside of splice actor
    pipe: move pipe_inode_info structure decleration up before it's used
    splice: remove do_splice_direct() symbol export
    splice: move inode size check into generic_file_splice_read()

    Linus Torvalds
     

09 Jun, 2007

2 commits


08 Jun, 2007

7 commits

  • This patch makes CIFS honour a process' umask like other filesystems.
    Of course the server is still free to munge the permissions if it wants
    to; but the client will send the "right" permissions to begin with.

    A few caveats:

    1) It only applies to filesystems that have CAP_UNIX (aka support unix
    extensions)
    2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
    after remote creation

    When mode to CIFS/NTFS ACL mapping is complete we can do the
    same thing for that case for servers which do not
    support the Unix Extensions.

    Signed-off-by: Matt Keenen
    Signed-off-by: Steve French

    Steve French
     
  • Original patch and description from Neil Brown ,
    merged and adapted to splice branch by me. Neils text follows:

    __generic_file_splice_read() currently samples the i_size at the start
    and doesn't do so again unless it needs to call ->readpage to load
    a page. After ->readpage it has to re-sample i_size as a truncate
    may have caused that page to be filled with zeros, and the read()
    call should not see these.

    However there are other activities that might cause ->readpage to be
    called on a page between the time that __generic_file_splice_read()
    samples i_size and when it finds that it has an uptodate page. These
    include at least read-ahead and possibly another thread performing a
    read

    So we must sample i_size *after* it has an uptodate page. Thus the
    current sampling at the start and after a read can be replaced with a
    sampling before page addition into spd.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • __generic_file_splice_read's partial page check, at eof after readpage,
    not only got its calculations wrong, but also reused the loff variable:
    causing data corruption when splicing from a non-0 offset in the file's
    last page (revealed by ext2 -b 1024 testing on a loop of a tmpfs file).

    Signed-off-by: Hugh Dickins
    Signed-off-by: Jens Axboe

    Hugh Dickins
     
  • I've seen inode related deadlocks, so move this call outside of the
    actor itself, which may hold the inode lock.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • It's only supposed to be used by do_sendfile(), which is never
    modular. So kill the export.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Signed-off-by: Jens Axboe

    Jens Axboe
     
  • This bug was caught by LTP testcase fchmod06 on Blackfin platform.

    In the manpage of fchmod, "EPERM: The effective UID does not match the
    owner of the file, and the process is not privileged (Linux: it does not
    have the CAP_FOWNER capability)."

    But the ramfs nommu code missed the inode_change_ok POSIX UID/GID
    verification. This patch fixed this.

    Signed-off-by: Bryan Wu
    Cc: David Howells
    Signed-off-by: Linus Torvalds

    Bryan Wu
     

07 Jun, 2007

2 commits

  • The write path code intends to bug if a math error (or unhandled case)
    results in a write outside of the current cluster boundaries. The actual
    BUG_ON() statements however are incorrect, leading to a crash on kernels
    with 64k page size. Fix those by checking against the right variables.

    Also, move the assertions higher up within the functions so that they trip
    *before* the code starts to mark buffers.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Some of the sysfs changes inadvertantly broke the simple runtime debug log
    filtering employed in ocfs2. Fix this by properly exporting the masklog
    category filter names.

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

    Tiger Yang
     

06 Jun, 2007

3 commits


05 Jun, 2007

3 commits

  • * git://git.infradead.org/mtd-2.6:
    [JFFS2] Fix obsoletion of metadata nodes in jffs2_add_tn_to_tree()
    [MTD] Fix error checking after get_mtd_device() in get_sb_mtd functions
    [JFFS2] Fix buffer length calculations in jffs2_get_inode_nodes()
    [JFFS2] Fix potential memory leak of dead xattrs on unmount.
    [JFFS2] Fix BUG() caused by failing to discard xattrs on deleted files.
    [MTD] generalise the handling of MTD-specific superblocks
    [MTD] [MAPS] don't force uclinux mtd map to be root dev

    Linus Torvalds
     
  • We've had several reoprts of the CPU jumping to 0x00000000 is do_ioctl(). I
    assume that there's a race and someone is zeroing out the ioctl handler while
    this CPU waits for the lock_kernel().

    The patch adds code to detect this, then emits stuff which will hopefuly lead
    us to the culprit.

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

    Andrew Morton
     
  • Slab cache used as memory pool can not be destroyed before the memory
    pool destruction. Because the memory pool still holds some objects and
    kmem_cache_destroy() says "Can't free all objects".

    Signed-off-by: Akinobu Mita
    Signed-off-by: Steve French

    Akinobu Mita
     

02 Jun, 2007

1 commit


01 Jun, 2007

4 commits