1. 10 7月, 2008 5 次提交
  2. 24 6月, 2008 1 次提交
  3. 17 5月, 2008 1 次提交
  4. 20 4月, 2008 3 次提交
  5. 20 3月, 2008 2 次提交
    • F
      nfs: nfs_redirty_request · 6d884e8f
      Fred 提交于
      Both flush functions have the same error handling routine.  Pull
      it out as a function.
      Signed-off-by: NFred Isaman <iisaman@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6d884e8f
    • F
      nfs: don't ignore return value from nfs_pageio_add_request · f8512ad0
      Fred Isaman 提交于
      Ignoring the return value from nfs_pageio_add_request can cause deadlocks.
      
      In read path:
        call nfs_pageio_add_request from readpage_async_filler
        assume at this point that there are requests already in desc, that
          can't be merged with the current request.
        so nfs_pageio_doio is fired up to clear out desc.
        assume something goes wrong in setting up the io, so desc->pg_error is set.
        This causes nfs_pageio_add_request to return 0, *WITHOUT* adding the original
          request.
        BUT, since return code is ignored, readpage_async_filler assumes it has
          been added, and does nothing further, leaving page locked.
        do_generic_mapping_read will eventually call lock_page, resulting in deadlock
      
      In write path:
        page is marked dirty by generic_perform_write
        nfs_writepages is called
        call nfs_pageio_add_request from nfs_page_async_flush
        assume at this point that there are requests already in desc, that
          can't be merged with the current request.
        so nfs_pageio_doio is fired up to clear out desc.
        assume something goes wrong in setting up the io, so desc->pg_error is set.
        This causes nfs_page_async_flush to return 0, *WITHOUT* adding the original
          request, yet marking the request as locked (PG_BUSY) and in writeback,
          clearing dirty marks.
        The next time a write is done to the page, deadlock will result as
          nfs_write_end calls nfs_update_request
      Signed-off-by: NFred Isaman <iisaman@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f8512ad0
  6. 08 3月, 2008 1 次提交
  7. 29 2月, 2008 1 次提交
  8. 26 2月, 2008 3 次提交
  9. 14 2月, 2008 1 次提交
  10. 08 2月, 2008 1 次提交
    • T
      NFS: Fix a potential file corruption issue when writing · 5d47a356
      Trond Myklebust 提交于
      If the inode is flagged as having an invalid mapping, then we can't rely on
      the PageUptodate() flag. Ensure that we don't use the "anti-fragmentation"
      write optimisation in nfs_updatepage(), since that will cause NFS to write
      out areas of the page that are no longer guaranteed to be up to date.
      
      A potential corruption could occur in the following scenario:
      
      client 1			client 2
      ===============			===============
      				fd=open("f",O_CREAT|O_WRONLY,0644);
      				write(fd,"fubar\n",6);	// cache last page
      				close(fd);
      fd=open("f",O_WRONLY|O_APPEND);
      write(fd,"foo\n",4);
      close(fd);
      
      				fd=open("f",O_WRONLY|O_APPEND);
      				write(fd,"bar\n",4);
      				close(fd);
      -----
      The bug may lead to the file "f" reading 'fubar\n\0\0\0\nbar\n' because
      client 2 does not update the cached page after re-opening the file for
      write. Instead it keeps it marked as PageUptodate() until someone calls
      invaldate_inode_pages2() (typically by calling read()).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5d47a356
  11. 06 2月, 2008 1 次提交
    • C
      Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user · eebd2aa3
      Christoph Lameter 提交于
      Simplify page cache zeroing of segments of pages through 3 functions
      
      zero_user_segments(page, start1, end1, start2, end2)
      
              Zeros two segments of the page. It takes the position where to
              start and end the zeroing which avoids length calculations and
      	makes code clearer.
      
      zero_user_segment(page, start, end)
      
              Same for a single segment.
      
      zero_user(page, start, length)
      
              Length variant for the case where we know the length.
      
      We remove the zero_user_page macro. Issues:
      
      1. Its a macro. Inline functions are preferable.
      
      2. The KM_USER0 macro is only defined for HIGHMEM.
      
         Having to treat this special case everywhere makes the
         code needlessly complex. The parameter for zeroing is always
         KM_USER0 except in one single case that we open code.
      
      Avoiding KM_USER0 makes a lot of code not having to be dealing
      with the special casing for HIGHMEM anymore. Dealing with
      kmap is only necessary for HIGHMEM configurations. In those
      configurations we use KM_USER0 like we do for a series of other
      functions defined in highmem.h.
      
      Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
      function could not be a macro. zero_user_* functions introduced
      here can be be inline because that constant is not used when these
      functions are called.
      
      Also extract the flushing of the caches to be outside of the kmap.
      
      [akpm@linux-foundation.org: fix nfs and ntfs build]
      [akpm@linux-foundation.org: fix ntfs build some more]
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Cc: David Chinner <dgc@sgi.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eebd2aa3
  12. 30 1月, 2008 6 次提交
  13. 07 12月, 2007 1 次提交
  14. 27 11月, 2007 1 次提交
  15. 20 10月, 2007 1 次提交
    • T
      NFS: Fix a writeback race... · 61e930a9
      Trond Myklebust 提交于
      This patch fixes a regression that was introduced by commit
      44dd151d
      
      We cannot zero the user page in nfs_mark_uptodate() any more, since
      
        a) We'd be modifying the page without holding the page lock
        b) We can race with other updates of the page, most notably
           because of the call to nfs_wb_page() in nfs_writepage_setup().
      
      Instead, we do the zeroing in nfs_update_request() if we see that we're
      creating a request that might potentially be marked as up to date.
      
      Thanks to Olivier Paquet for reporting the bug and providing a test-case.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      61e930a9
  16. 17 10月, 2007 2 次提交
  17. 10 10月, 2007 7 次提交
  18. 01 9月, 2007 1 次提交
    • T
      NFS: Fix a write request leak in nfs_invalidate_page() · 1b3b4a1a
      Trond Myklebust 提交于
      Ryusuke Konishi says:
      
      The recent truncate_complete_page() clears the dirty flag from a page
      before calling a_ops->invalidatepage(),
      ^^^^^^
      static void
      truncate_complete_page(struct address_space *mapping, struct page *page)
      {
              ...
              cancel_dirty_page(page, PAGE_CACHE_SIZE);  <--- Inserted here at
      kernel 2.6.20
      
              if (PagePrivate(page))
                      do_invalidatepage(page, 0);   ---> will call
      a_ops->invalidatepage()
              ...
      }
      
      and this is disturbing nfs_wb_page_priority() from calling 
      nfs_writepage_locked() that is expected to handle the pending
      request (=nfs_page) associated with the page.
      
      int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
      {
              ...
              if (clear_page_dirty_for_io(page)) {
                      ret = nfs_writepage_locked(page, &wbc);
                      if (ret < 0)
                              goto out;
              }
              ...
      }
      
      Since truncate_complete_page() will get rid of the page after
      a_ops->invalidatepage() returns, the request (=nfs_page) associated
      with the page becomes a garbage in nfs_inode->nfs_page_tree.
      ------------------------
      
      Fix this by ensuring that nfs_wb_page_priority() recognises that it may
      also need to clear out non-dirty pages that have an nfs_page associated
      with them.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1b3b4a1a
  19. 20 7月, 2007 1 次提交
    • P
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt 提交于
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      20c2df83