1. 19 Jul, 2007 15 commits
    • Nick Piggin's avatar
      mm: fault feedback #1 · d0217ac0
      Nick Piggin authored
      Change ->fault prototype.  We now return an int, which contains
      VM_FAULT_xxx code in the low byte, and FAULT_RET_xxx code in the next byte.
       FAULT_RET_ code tells the VM whether a page was found, whether it has been
      locked, and potentially other things.  This is not quite the way he wanted
      it yet, but that's changed in the next patch (which requires changes to
      arch code).
      
      This means we no longer set VM_CAN_INVALIDATE in the vma in order to say
      that a page is locked which requires filemap_nopage to go away (because we
      can no longer remain backward compatible without that flag), but we were
      going to do that anyway.
      
      struct fault_data is renamed to struct vm_fault as Linus asked. address
      is now a void __user * that we should firmly encourage drivers not to use
      without really good reason.
      
      The page is now returned via a page pointer in the vm_fault struct.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d0217ac0
    • Mark Fasheh's avatar
      Document ->page_mkwrite() locking · ed2f2f9b
      Mark Fasheh authored
      There seems to be very little documentation about this callback in general.
      The locking in particular is a bit tricky, so it's worth having this in
      writing.
      Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ed2f2f9b
    • Mark Fasheh's avatar
      ocfs2: release page lock before calling ->page_mkwrite · 69676147
      Mark Fasheh authored
      __do_fault() was calling ->page_mkwrite() with the page lock held, which
      violates the locking rules for that callback.  Release and retake the page
      lock around the callback to avoid deadlocking file systems which manually
      take it.
      Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      69676147
    • Nick Piggin's avatar
      mm: merge populate and nopage into fault (fixes nonlinear) · 54cb8821
      Nick Piggin authored
      Nonlinear mappings are (AFAIKS) simply a virtual memory concept that encodes
      the virtual address -> file offset differently from linear mappings.
      
      ->populate is a layering violation because the filesystem/pagecache code
      should need to know anything about the virtual memory mapping.  The hitch here
      is that the ->nopage handler didn't pass down enough information (ie.  pgoff).
       But it is more logical to pass pgoff rather than have the ->nopage function
      calculate it itself anyway (because that's a similar layering violation).
      
      Having the populate handler install the pte itself is likewise a nasty thing
      to be doing.
      
      This patch introduces a new fault handler that replaces ->nopage and
      ->populate and (later) ->nopfn.  Most of the old mechanism is still in place
      so there is a lot of duplication and nice cleanups that can be removed if
      everyone switches over.
      
      The rationale for doing this in the first place is that nonlinear mappings are
      subject to the pagefault vs invalidate/truncate race too, and it seemed stupid
      to duplicate the synchronisation logic rather than just consolidate the two.
      
      After this patch, MAP_NONBLOCK no longer sets up ptes for pages present in
      pagecache.  Seems like a fringe functionality anyway.
      
      NOPAGE_REFAULT is removed.  This should be implemented with ->fault, and no
      users have hit mainline yet.
      
      [akpm@linux-foundation.org: cleanup]
      [randy.dunlap@oracle.com: doc. fixes for readahead]
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      54cb8821
    • Nick Piggin's avatar
      mm: fix fault vs invalidate race for linear mappings · d00806b1
      Nick Piggin authored
      Fix the race between invalidate_inode_pages and do_no_page.
      
      Andrea Arcangeli identified a subtle race between invalidation of pages from
      pagecache with userspace mappings, and do_no_page.
      
      The issue is that invalidation has to shoot down all mappings to the page,
      before it can be discarded from the pagecache.  Between shooting down ptes to
      a particular page, and actually dropping the struct page from the pagecache,
      do_no_page from any process might fault on that page and establish a new
      mapping to the page just before it gets discarded from the pagecache.
      
      The most common case where such invalidation is used is in file truncation.
      This case was catered for by doing a sort of open-coded seqlock between the
      file's i_size, and its truncate_count.
      
      Truncation will decrease i_size, then increment truncate_count before
      unmapping userspace pages; do_no_page will read truncate_count, then find the
      page if it is within i_size, and then check truncate_count under the page
      table lock and back out and retry if it had subsequently been changed (ptl
      will serialise against unmapping, and ensure a potentially updated
      truncate_count is actually visible).
      
      Complexity and documentation issues aside, the locking protocol fails in the
      case where we would like to invalidate pagecache inside i_size.  do_no_page
      can come in anytime and filemap_nopage is not aware of the invalidation in
      progress (as it is when it is outside i_size).  The end result is that
      dangling (->mapping == NULL) pages that appear to be from a particular file
      may be mapped into userspace with nonsense data.  Valid mappings to the same
      place will see a different page.
      
      Andrea implemented two working fixes, one using a real seqlock, another using
      a page->flags bit.  He also proposed using the page lock in do_no_page, but
      that was initially considered too heavyweight.  However, it is not a global or
      per-file lock, and the page cacheline is modified in do_no_page to increment
      _count and _mapcount anyway, so a further modification should not be a large
      performance hit.  Scalability is not an issue.
      
      This patch implements this latter approach.  ->nopage implementations return
      with the page locked if it is possible for their underlying file to be
      invalidated (in that case, they must set a special vm_flags bit to indicate
      so).  do_no_page only unlocks the page after setting up the mapping
      completely.  invalidation is excluded because it holds the page lock during
      invalidation of each page (and ensures that the page is not mapped while
      holding the lock).
      
      This also allows significant simplifications in do_no_page, because we have
      the page locked in the right place in the pagecache from the start.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d00806b1
    • Linus Torvalds's avatar
      Merge branch 'isdn-fix' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 · 589f1e81
      Linus Torvalds authored
      * 'isdn-fix' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
        ISDN HiSax: uninitialized return in hisax_cs_setup
      589f1e81
    • Linus Torvalds's avatar
      Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 · ce524c83
      Linus Torvalds authored
      * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
        eHEA: Fix bonding support
        Blackfin ethernet driver: on chip ethernet MAC controller driver
        fix wrong argument of tc35815_read_plat_dev_addr()
        ARM/ETHER3: Handle multicast frames.
        SAA9730: Handle multicast frames.
        NI5010: Handle multicast frames.
        NS83820: Handle multicast frames.
        Fix RGMII-ID handling in gianfar
        Fix Vitesse RGMII-ID support
        Add phy-connection-type to gianfar nodes
        Fix Vitesse 824x PHY interrupt acking
        [PATCH] zd1211rw: Add ID for Siemens Gigaset USB Stick 54
        [PATCH] zd1211rw: Add ID for Planex GW-US54GXS
        [PATCH] Update version ipw2200 stamp to 1.2.2
        [PATCH] ipw2200: Fix ipw_isr() comments error on shared IRQ
        [PATCH] Fix ipw2200 set wrong power parameter causing firmware error
        [PATCH] ipw2100: Fix `iwpriv set_power` error
        [PATCH] softmac: Channel is listed twice in scan output
      ce524c83
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · 789c56b7
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (24 commits)
        [CIFS] merge conflict in fs/cifs/export.c
        [CIFS] Allow disabling CIFS Unix Extensions as mount option
        [CIFS] More whitespace/formatting fixes (noticed by checkpatch)
        [CIFS] Typo in previous patch
        [CIFS] zero_user_page() conversions
        [CIFS] use simple_prepare_write to zero page data
        [CIFS] Fix build break - inet.h not included when experimental ifdef off
        [CIFS] Add support for new POSIX unlink
        [CIFS] whitespace/formatting fixes
        [CIFS] Fix oops in cifs_create when nfsd server exports cifs mount
        [CIFS] whitespace cleanup
        [CIFS] Fix packet signatures for NTLMv2 case
        [CIFS] more whitespace fixes
        [CIFS] more whitespace cleanup
        [CIFS] whitespace cleanup
        [CIFS] whitespace cleanup
        [CIFS] ipv6 support no longer experimental
        [CIFS] Mount should fail if server signing off but client mount option requires it
        [CIFS] whitespace fixes
        [CIFS] Fix sign mount option and sign proc config setting
        ...
      789c56b7
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/docs-2.6 · 7209a1dc
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/docs-2.6:
        zh_CN/HOWTO: update URLs of git trees
        Chinese translation of Documentation/stable_api_nonsense.txt
        HOWTO: add Chinese translation of Documentation/HOWTO
        Documentation: add Japanese translated stable_api_nonsense.txt
        HOWTO: add Japanese translation of Documentation/HOWTO
      7209a1dc
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 · 29e7ee37
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
        sysfs: cosmetic clean up on node creation failure paths
        sysfs: kill an extra put in sysfs_create_link() failure path
        Driver core: check return code of sysfs_create_link()
        HOWTO: Add the knwon_regression URI to the documentation
        dev_vdbg() documentation
        dev_vdbg(), available with -DVERBOSE_DEBUG
        sysfs: make sysfs_init_inode() static
        sysfs: fix sysfs root inode nlink accounting
        Documentation fix devres.txt: lib/iomap.c -> lib/devres.c
        sysfs: avoid kmem_cache_free(NULL)
        PM: remove deprecated dpm_runtime_* routines
        PM: Remove deprecated sysfs files
        Driver core: accept all valid action-strings in uevent-trigger
        debugfs: remove rmdir() non-empty complaint
      29e7ee37
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/uio-2.6 · fc15bc81
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/uio-2.6:
        UIO: Hilscher CIF card driver
        UIO: Documentation
        UIO: Add the User IO core code
      fc15bc81
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux · a8dcf12f
      Linus Torvalds authored
      * 'for-linus' of git://linux-nfs.org/~bfields/linux:
        locks: fix vfs_test_lock() comment
        locks: make posix_test_lock() interface more consistent
        nfs: disable leases over NFS
        gfs2: stop giving out non-cluster-coherent leases
        locks: export setlease to filesystems
        locks: provide a file lease method enabling cluster-coherent leases
        locks: rename lease functions to reflect locks.c conventions
        locks: share more common lease code
        locks: clean up lease_alloc()
        locks: convert an -EINVAL return to a BUG
        leases: minor break_lease() comment clarification
      a8dcf12f
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband · d796e641
      Linus Torvalds authored
      * 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband: (29 commits)
        IB/mthca: Simplify use of size0 in work request posting
        IB/mthca: Factor out setting WQE UD segment entries
        IB/mthca: Factor out setting WQE remote address and atomic segment entries
        IB/mlx4: Factor out setting other WQE segments
        IB/mlx4: Factor out setting WQE data segment entries
        IB/mthca: Factor out setting WQE data segment entries
        IB/mlx4: Return receive queue sizes for userspace QPs from query QP
        IB/mlx4: Increase max outstanding RDMA reads as target
        RDMA/cma: Remove local write permission from QP access flags
        IB/mthca: Use uninitialized_var() for f0
        IB/cm: Make internal function cm_get_ack_delay() static
        IB/ipath: Remove ipath_get_user_pages_nocopy()
        IB/ipath: Make a few functions static
        mlx4_core: Reset device when internal error is detected
        IB/iser: Make a couple of functions static
        IB/mthca: Fix printk format used for firmware version in warning
        IB/mthca: Schedule MSI support for removal
        IB/ehca: Fix warnings issued by checkpatch.pl
        IB/ehca: Restructure ehca_set_pagebuf()
        IB/ehca: MR/MW structure refactoring
        ...
      d796e641
    • Steve French's avatar
      Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6 · 1ff8392c
      Steve French authored
      Conflicts:
      
      	fs/cifs/export.c
      1ff8392c
    • Steve French's avatar
      [CIFS] merge conflict in fs/cifs/export.c · 70b315b0
      Steve French authored
      Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
      70b315b0
  2. 18 Jul, 2007 25 commits