25 Sep, 2010

1 commit

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
    o2dlm: force free mles during dlm exit
    ocfs2: Sync inode flags with ext2.
    ocfs2: Move 'wanted' into parens of ocfs2_resmap_resv_bits.
    ocfs2: Use cpu_to_le16 for e_leaf_clusters in ocfs2_bg_discontig_add_extent.
    ocfs2: update ctime when changing the file's permission by setfacl
    ocfs2/net: fix uninitialized ret in o2net_send_message_vec()
    Ocfs2: Handle empty list in lockres_seq_start() for dlmdebug.c
    Ocfs2: Re-access the journal after ocfs2_insert_extent() in dxdir codes.
    ocfs2: Fix lockdep warning in reflink.
    ocfs2/lockdep: Move ip_xattr_sem out of ocfs2_xattr_get_nolock.

    Linus Torvalds
     

24 Sep, 2010

5 commits

  • While umounting, a block mle doesn't get freed if dlm is shutdown after
    master request is received but before assert master. This results in unclean
    shutdown of dlm domain.

    This patch frees all mles that lie around after other nodes were notified about
    exiting the dlm and marking dlm state as leaving. Only block mles are expected
    to be around, so we log ERROR for other mles but still free them.

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Joel Becker

    Srinivas Eeda
     
  • We sync our inode flags with ext2 and define them by hex
    values. But actually in commit 3669567(4 years ago), all
    these values are moved to include/linux/fs.h. So we'd
    better also use them as what ext2 did. So sync our inode
    flags with ext2 by using FS_*.

    Signed-off-by: Tao Ma
    Signed-off-by: Joel Becker

    Tao Ma
     
  • The first time I read the function ocfs2_resmap_resv_bits, I consider
    about what 'wanted' will be used and consider about the comments.
    Then I find it is only used if the reservation is empty. ;)

    So we'd better move it to the parens so that it make the code more
    readable, what's more, ocfs2_resmap_resv_bits is used so frequently
    and we should save some cpus.

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

    Tao Ma
     
  • e_leaf_clusters is a le16, so use cpu_to_le16 instead
    of cpu_to_le32.

    What's more, we change 'clusters' to unsigned int to
    signify that the size of 'clusters' isn't important here.

    Signed-off-by: Tao Ma
    Signed-off-by: Joel Becker

    Tao Ma
     
  • In commit 30e2bab, ext3 fixed it. So change it accordingly in ocfs2.

    Steps to reproduce:
    # touch aaa
    # stat -c %Z aaa
    1283760364
    # setfacl -m 'u::x,g::x,o::x' aaa
    # stat -c %Z aaa
    1283760364

    Signed-off-by: Tao Ma
    Signed-off-by: Joel Becker

    Tao Ma
     

23 Sep, 2010

5 commits

  • Currently, /proc//smaps has wrong dirty pages accounting.
    Shared_Dirty and Private_Dirty output only pte dirty pages and ignore
    PG_dirty page flag. It is difference against documentation, but also
    inconsistent against Referenced field. (Referenced checks both pte and
    page flags)

    This patch fixes it.

    Test program:

    large-array.c
    ---------------------------------------------------
    #include
    #include
    #include
    #include

    char array[1*1024*1024*1024L];

    int main(void)
    {
    memset(array, 1, sizeof(array));
    pause();

    return 0;
    }
    ---------------------------------------------------

    Test case:
    1. run ./large-array
    2. cat /proc/`pidof large-array`/smaps
    3. swapoff -a
    4. cat /proc/`pidof large-array`/smaps again

    Test result:

    00601000-40601000 rw-p 00000000 00:00 0
    Size: 1048576 kB
    Rss: 1048576 kB
    Pss: 1048576 kB
    Shared_Clean: 0 kB
    Shared_Dirty: 0 kB
    Private_Clean: 218992 kB

    00601000-40601000 rw-p 00000000 00:00 0
    Size: 1048576 kB
    Rss: 1048576 kB
    Pss: 1048576 kB
    Shared_Clean: 0 kB
    Shared_Dirty: 0 kB
    Private_Clean: 0 kB
    Private_Dirty: 1048576 kB
    Acked-by: Hugh Dickins
    Cc: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • OCFS2 can return ERESTARTSYS from its write function when the process is
    signalled while waiting for a cluster lock (and the filesystem is mounted
    with intr mount option). Generally, it seems reasonable to allow
    filesystems to return this error code from its IO functions. As we must
    not leak ERESTARTSYS (and similar error codes) to userspace as a result of
    an AIO operation, we have to properly convert it to EINTR inside AIO code
    (restarting the syscall isn't really an option because other AIO could
    have been already submitted by the same io_submit syscall).

    Signed-off-by: Jan Kara
    Reviewed-by: Jeff Moyer
    Cc: Christoph Hellwig
    Cc: Zach Brown
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • Commit 73296bc611 ("procfs: Use generic_file_llseek in /proc/vmcore")
    broke seeking on /proc/vmcore. This changes it back to use default_llseek
    in order to restore the original behaviour.

    The problem with generic_file_llseek is that it only allows seeks up to
    inode->i_sb->s_maxbytes, which is zero on procfs and some other virtual
    file systems. We should merge generic_file_llseek and default_llseek some
    day and clean this up in a proper way, but for 2.6.35/36, reverting vmcore
    is the safer solution.

    Signed-off-by: Arnd Bergmann
    Cc: Frederic Weisbecker
    Reported-by: CAI Qian
    Tested-by: CAI Qian
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • In 32-bit compatibility mode, the error handling for
    compat_do_readv_writev() may free an uninitialized pointer, potentially
    leading to all sorts of ugly memory corruption. This is reliably
    triggerable by unprivileged users by invoking the readv()/writev()
    syscalls with an invalid iovec pointer. The below patch fixes this to
    emulate the non-compat version.

    Introduced by commit b83733639a49 ("compat: factor out
    compat_rw_copy_check_uvector from compat_do_readv_writev")

    Signed-off-by: Dan Rosenberg
    Cc: stable@kernel.org (2.6.35)
    Cc: Al Viro
    Signed-off-by: Linus Torvalds

    Dan Rosenberg
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    bdi: Fix warnings in __mark_inode_dirty for /dev/zero and friends
    char: Mark /dev/zero and /dev/kmem as not capable of writeback
    bdi: Initialize noop_backing_dev_info properly
    cfq-iosched: fix a kernel OOPs when usb key is inserted
    block: fix blk_rq_map_kern bio direction flag
    cciss: freeing uninitialized data on error path

    Linus Torvalds
     

22 Sep, 2010

3 commits

  • Inodes of devices such as /dev/zero can get dirty for example via
    utime(2) syscall or due to atime update. Backing device of such inodes
    (zero_bdi, etc.) is however unable to handle dirty inodes and thus
    __mark_inode_dirty complains. In fact, inode should be rather dirtied
    against backing device of the filesystem holding it. This is generally a
    good rule except for filesystems such as 'bdev' or 'mtd_inodefs'. Inodes
    in these pseudofilesystems are referenced from ordinary filesystem
    inodes and carry mapping with real data of the device. Thus for these
    inodes we have to use inode->i_mapping->backing_dev_info as we did so
    far. We distinguish these filesystems by checking whether sb->s_bdi
    points to a non-trivial backing device or not.

    Example: Assume we have an ext3 filesystem on /dev/sda1 mounted on /.
    There's a device inode A described by a path "/dev/sdb" on this
    filesystem. This inode will be dirtied against backing device "8:0"
    after this patch. bdev filesystem contains block device inode B coupled
    with our inode A. When someone modifies a page of /dev/sdb, it's B that
    gets dirtied and the dirtying happens against the backing device "8:16".
    Thus both inodes get filed to a correct bdi list.

    Cc: stable@kernel.org
    Signed-off-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jan Kara
     
  • These devices don't do any writeback but their device inodes still can get
    dirty so mark bdi appropriately so that bdi code does the right thing and files
    inodes to lists of bdi carrying the device inodes.

    Cc: stable@kernel.org
    Signed-off-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jan Kara
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    ceph: select CRYPTO
    ceph: check mapping to determine if FILE_CACHE cap is used
    ceph: only send one flushsnap per cap_snap per mds session
    ceph: fix cap_snap and realm split
    ceph: stop sending FLUSHSNAPs when we hit a dirty capsnap
    ceph: correctly set 'follows' in flushsnap messages
    ceph: fix dn offset during readdir_prepopulate
    ceph: fix file offset wrapping at 4GB on 32-bit archs
    ceph: fix reconnect encoding for old servers
    ceph: fix pagelist kunmap tail
    ceph: fix null pointer deref on anon root dentry release

    Linus Torvalds
     

20 Sep, 2010

1 commit

  • Coda's REQ_* defines were renamed to avoid clashes with the block layer
    (commit 4aeefdc69f7b: "coda: fixup clash with block layer REQ_*
    defines").

    However one was missed and response messages are no longer matched with
    requests and waiting threads are no longer woken up. This patch fixes
    this.

    Signed-off-by: Jan Harkes
    [ Also fixed up whitespace while at it -Linus ]
    Signed-off-by: Linus Torvalds

    Jan Harkes
     

18 Sep, 2010

3 commits


17 Sep, 2010

4 commits


15 Sep, 2010

5 commits

  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    SUNRPC: Fix the NFSv4 and RPCSEC_GSS Kconfig dependencies
    statfs() gives ESTALE error
    NFS: Fix a typo in nfs_sockaddr_match_ipaddr6
    sunrpc: increase MAX_HASHTABLE_BITS to 14
    gss:spkm3 miss returning error to caller when import security context
    gss:krb5 miss returning error to caller when import security context
    Remove incorrect do_vfs_lock message
    SUNRPC: cleanup state-machine ordering
    SUNRPC: Fix a race in rpc_info_open
    SUNRPC: Fix race corrupting rpc upcall
    Fix null dereference in call_allocate

    Linus Torvalds
     
  • Tavis Ormandy pointed out that do_io_submit does not do proper bounds
    checking on the passed-in iocb array:

           if (unlikely(nr < 0))
                   return -EINVAL;

           if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(iocbpp)))))
                   return -EFAULT;                      ^^^^^^^^^^^^^^^^^^

    The attached patch checks for overflow, and if it is detected, the
    number of iocbs submitted is scaled down to a number that will fit in
    the long.  This is an ok thing to do, as sys_io_submit is documented as
    returning the number of iocbs submitted, so callers should handle a
    return value of less than the 'nr' argument passed in.

    Reported-by: Tavis Ormandy
    Signed-off-by: Jeff Moyer
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • cifs_get_smb_ses must be called on a server pointer on which it holds an
    active reference. It first does a search for an existing SMB session. If
    it finds one, it'll put the server reference and then try to ensure that
    the negprot is done, etc.

    If it encounters an error at that point then it'll return an error.
    There's a potential problem here though. When cifs_get_smb_ses returns
    an error, the caller will also put the TCP server reference leading to a
    double-put.

    Fix this by having cifs_get_smb_ses only put the server reference if
    it found an existing session that it could use and isn't returning an
    error.

    Cc: stable@kernel.org
    Reviewed-by: Suresh Jayaraman
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Stop sending FLUSHSNAP messages when we hit a capsnap that has dirty_pages
    or is still writing. We'll send the newer capsnaps only after the older
    ones complete.

    Signed-off-by: Sage Weil

    Sage Weil
     
  • The 'follows' should match the seq for the snap context for the given snap
    cap, which is the context under which we have been dirtying and writing
    data and metadata. The snapshot that _contains_ those updates thus
    _follows_ that context's seq #.

    Signed-off-by: Sage Weil

    Sage Weil
     

14 Sep, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: prevent possible memory corruption in cifs_demultiplex_thread
    cifs: eliminate some more premature cifsd exits
    cifs: prevent cifsd from exiting prematurely
    [CIFS] ntlmv2/ntlmssp remove-unused-function CalcNTLMv2_partial_mac_key
    cifs: eliminate redundant xdev check in cifs_rename
    Revert "[CIFS] Fix ntlmv2 auth with ntlmssp"
    Revert "missing changes during ntlmv2/ntlmssp auth and sign"
    Revert "Eliminate sparse warning - bad constant expression"
    Revert "[CIFS] Eliminate unused variable warning"

    Linus Torvalds
     
  • When adding the readdir results to the cache, ceph_set_dentry_offset was
    clobbered our just-set offset. This can cause the readdir result offsets
    to get out of sync with the server. Add an argument to the helper so
    that it does not.

    This bug was introduced by 1cd3935bedccf592d44343890251452a6dd74fc4.

    Signed-off-by: Sage Weil

    Sage Weil
     

13 Sep, 2010

9 commits

  • We should not use dotlversion for the dotu inode operations

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

    Aneesh Kumar K.V
     
  • We should use the cached dentry operation only if caching mode is enabled

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

    Aneesh Kumar K.V
     
  • NULL fid should be handled in cases where we endup calling v9fs_dir_release()
    before even we instantiate the fid in filp.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    jvrao
     
  • This was introduced by 7cadb63d58a932041afa3f957d5cbb6ce69dcee5

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

    Aneesh Kumar K.V
     
  • Four memory leak fixes in the 9P code.

    Signed-off-by: Latchesar Ionkov
    Signed-off-by: Eric Van Hensbergen

    Latchesar Ionkov
     
  • The NFSv4 client's callback server calls svc_gss_principal(), which
    is defined in the auth_rpcgss.ko

    The NFSv4 server has the same dependency, and in addition calls
    svcauth_gss_flavor(), gss_mech_get_by_pseudoflavor(),
    gss_pseudoflavor_to_service() and gss_mech_put() from the same module.

    The module auth_rpcgss itself has no dependencies aside from sunrpc,
    so we only need to select RPCSEC_GSS.

    Reported-by: Uwe Kleine-König
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Hi,

    An NFS client executes a statfs("file", &buff) call.
    "file" exists / existed, the client has read / written it,
    but it has already closed it.

    user_path(pathname, &path) looks up "file" successfully in the
    directory-cache and restarts the aging timer of the directory-entry.
    Even if "file" has already been removed from the server, because the
    lookupcache=positive option I use, keeps the entries valid for a while.

    nfs_statfs() returns ESTALE if "file" has already been removed from the
    server.

    If the user application repeats the statfs("file", &buff) call, we
    are stuck: "file" remains young forever in the directory-cache.

    Signed-off-by: Zoltan Menyhart
    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Menyhart Zoltan
     
  • Reported-by: Ben Greear
    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     
  • The do_vfs_lock function on fs/nfs/file.c is only called if NLM is
    not being used, via the -onolock mount option. Therefore it cannot
    really be "out of sync with lock manager" when the local locking
    function called returns an error, as there will be no corresponding
    call to the NLM. For details, simply check the if/else on do_setlk
    and do_unlk on fs/nfs/file.c.

    Signed-Off-By: Fabio Olive Leite
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Fabio Olive Leite
     

12 Sep, 2010

2 commits