1. 05 9月, 2007 6 次提交
  2. 03 9月, 2007 1 次提交
    • J
      [JFFS2] fix write deadlock regression · fc0e0197
      Jason Lunz 提交于
      I've bisected the deadlock when many small appends are done on jffs2 down to
      this commit:
      
      commit 6fe6900e
      Author: Nick Piggin <npiggin@suse.de>
      Date:   Sun May 6 14:49:04 2007 -0700
      
          mm: make read_cache_page synchronous
      
          Ensure pages are uptodate after returning from read_cache_page, which allows
          us to cut out most of the filesystem-internal PageUptodate calls.
      
          I didn't have a great look down the call chains, but this appears to fixes 7
          possible use-before uptodate in hfs, 2 in hfsplus, 1 in jfs, a few in
          ecryptfs, 1 in jffs2, and a possible cleared data overwritten with readpage in
          block2mtd.  All depending on whether the filler is async and/or can return
          with a !uptodate page.
      
      It introduced a wait to read_cache_page, as well as a
      read_cache_page_async function equivalent to the old read_cache_page
      without any callers.
      
      Switching jffs2_gc_fetch_page to read_cache_page_async for the old
      behavior makes the deadlocks go away, but maybe reintroduces the
      use-before-uptodate problem? I don't understand the mm/fs interaction
      well enough to say.
      
      [It's fine. dwmw2.]
      Signed-off-by: NJason Lunz <lunz@falooley.org>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      fc0e0197
  3. 01 9月, 2007 9 次提交
    • 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
    • C
      NFS: change NFS mount error return when hostname/pathname too long · 7d1cca72
      Chuck Lever 提交于
      According to the mount(2) man page, the proper error return code for the
      mount(2) system call when the special device name or the mounted-on
      directory name is too long is ENAMETOOLONG.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7d1cca72
    • C
      NFS: Off-by-one length error in string handling · 350c73af
      Chuck Lever 提交于
      The hostname was getting truncated in the new text-based NFS mount API.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      350c73af
    • C
      NFS: Return a real error code from mount(2) · fdc6e2c8
      Chuck Lever 提交于
      Don't filter the return code from the in-kernel rpcbind or NFS mount
      clients.  Return the real error code so that callers of the new NFS
      text-based mount API can apply a useful retry strategy.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fdc6e2c8
    • C
      NFS: mount option parser chokes on proto= · fdb66ff4
      Chuck Lever 提交于
      The new text-based NFS mount option parsing logic doesn't recognize any
      valid transport protocols due to a silly mistake in the protocol token
      matching logic.  This prevents basic mount requests such as:
      
         mount.nfs server:/export /mnt -o proto=tcp
      
      from working with the new text-based NFS mount API.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fdb66ff4
    • T
      NFSv4: Ensure that we pass the correct dentry to nfs4_intent_set_file · deee9369
      Trond Myklebust 提交于
      This patch fixes an Oops that was reported by Gabriel Barazer.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      deee9369
    • T
      NFSv4: Fix a typo in _nfs4_do_open_reclaim · 65bbf6bd
      Trond Myklebust 提交于
      This should fix the following Oops reported by Jeff Garzik:
      
      kernel BUG at fs/nfs/nfs4xdr.c:1040!
      invalid opcode: 0000 [1] SMP 
      CPU 0 
      Modules linked in: nfs lockd sunrpc af_packet
      ipv6 cpufreq_ondemand acpi_cpufreq battery floppy nvram sg snd_hda_intel
      ata_generic snd_pcm_oss snd_mixer_oss snd_pcm i2c_i801 snd_page_alloc e1000
      firewire_ohci ata_piix i2c_core sr_mod cdrom sata_sil ahci libata sd_mod
      scsi_mod ext3 jbd ehci_hcd uhci_hcd
      Pid: 16353, comm: 10.10.10.1-recl Not tainted 2.6.23-rc3 #1
      RIP: 0010:[<ffffffff88240980>] [<ffffffff88240980>] :nfs:encode_open+0x1c0/0x330
      RSP: 0018:ffff8100467c5c60  EFLAGS: 00010202
      RAX: ffff81000f89b8b8 RBX: 00000000697a6f6d RCX: ffff81000f89b8b8
      RDX: 0000000000000004 RSI: 0000000000000004 RDI: ffff8100467c5c80
      RBP: ffff8100467c5c80 R08: ffff81000f89bc30 R09: ffff81000f89b83f
      R10: 0000000000000001 R11: ffffffff881e79e0 R12: ffff81003cbd1808
      R13: ffff81000f89b860 R14: ffff81005fc984e0 R15: ffffffff88240af0
      FS:  0000000000000000(0000) GS:ffffffff8052a000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 00002adb9e51a030 CR3: 000000007ea7e000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process 10.10.10.1-recl (pid: 16353, threadinfo ffff8100467c4000, task ffff8100038ce780)
      Stack:  ffff81004aeb6a40 ffff81003cbd1808 ffff81003cbd1808 ffffffff88240b5d
       ffff81000f89b8bc ffff81005fc984e8 ffff81000f89bc30 ffff81005fc984e8
       0000000300000000 0000000000000000 0000000000000000 ffff81003cbd1800
      Call Trace:
       [<ffffffff88240b5d>] :nfs:nfs4_xdr_enc_open_noattr+0x6d/0x90
       [<ffffffff881e74b7>] :sunrpc:rpcauth_wrap_req+0x97/0xf0
       [<ffffffff88240af0>] :nfs:nfs4_xdr_enc_open_noattr+0x0/0x90
       [<ffffffff881df57a>] :sunrpc:call_transmit+0x18a/0x290
       [<ffffffff881e5e7b>] :sunrpc:__rpc_execute+0x6b/0x290
       [<ffffffff881dff76>] :sunrpc:rpc_do_run_task+0x76/0xd0
       [<ffffffff882373f6>] :nfs:_nfs4_proc_open+0x76/0x230
       [<ffffffff88237a2e>] :nfs:nfs4_open_recover_helper+0x5e/0xc0
       [<ffffffff88237b74>] :nfs:nfs4_open_recover+0xe4/0x120
       [<ffffffff88238e14>] :nfs:nfs4_open_reclaim+0xa4/0xf0
       [<ffffffff882413c5>] :nfs:nfs4_reclaim_open_state+0x55/0x1b0
       [<ffffffff882417ea>] :nfs:reclaimer+0x2ca/0x390
       [<ffffffff88241520>] :nfs:reclaimer+0x0/0x390
       [<ffffffff8024e59b>] kthread+0x4b/0x80
       [<ffffffff8020cad8>] child_rip+0xa/0x12
       [<ffffffff8024e550>] kthread+0x0/0x80
       [<ffffffff8020cace>] child_rip+0x0/0x12
      
      
      Code: 0f 0b eb fe 48 89 ef c7 00 00 00 00 02 be 08 00 00 00 e8 79 
      RIP  [<ffffffff88240980>] :nfs:encode_open+0x1c0/0x330
       RSP <ffff8100467c5c60>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      65bbf6bd
    • T
      NFS: Fix use of cancel_delayed_work_sync in nfs_release_automount_timer · 560aef74
      Trond Myklebust 提交于
      Doh! We can't use cancel_delayed_work_sync because we may have been called
      from an unmount that was being performed by nfs_automount_task.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      560aef74
    • T
      NFS: Fix the mount regression · e89a5a43
      Trond Myklebust 提交于
      This avoids the recent NFS mount regression (returning EBUSY when
      mounting the same filesystem twice with different parameters).
      
      The best I can do given the constraints appears to be to have the kernel
      first look for a superblock that matches both the fsid and the
      user-specified mount options, and then spawn off a new superblock if
      that search fails.
      
      Note that this is not the same as specifying nosharecache everywhere
      since nosharecache will never attempt to match an existing superblock.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Tested-by: NHua Zhong <hzhong@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e89a5a43
  4. 31 8月, 2007 5 次提交
  5. 23 8月, 2007 8 次提交
  6. 21 8月, 2007 2 次提交
    • Z
      dio: zero struct dio with kzalloc instead of manually · 848c4dd5
      Zach Brown 提交于
      This patch uses kzalloc to zero all of struct dio rather than manually
      trying to track which fields we rely on being zero.  It passed aio+dio
      stress testing and some bug regression testing on ext3.
      
      This patch was introduced by Linus in the conversation that lead up to
      Badari's minimal fix to manually zero .map_bh.b_state in commit:
      
        6a648fa7
      
      It makes the code a bit smaller.  Maybe a couple fewer cachelines to
      load, if we're lucky:
      
         text    data     bss     dec     hex filename
      3285925  568506 1304616 5159047  4eb887 vmlinux
      3285797  568506 1304616 5158919  4eb807 vmlinux.patched
      
      I was unable to measure a stable difference in the number of cpu cycles
      spent in blockdev_direct_IO() when pushing aio+dio 256K reads at
      ~340MB/s.
      
      So the resulting intent of the patch isn't a performance gain but to
      avoid exposing ourselves to the risk of finding another field like
      .map_bh.b_state where we rely on zeroing but don't enforce it in the
      code.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      848c4dd5
    • D
      JFFS2 locking regression fix. · b5748643
      David Woodhouse 提交于
      Commit a491486a introduced a locking
      problem in JFFS2 -- we up() the alloc_sem when we weren't previously
      holding it. This leads to all kinds of fun behaviour later.
      
      There was a _reason_ for the
      	if (1 /* alternative path needs testing */ ||
      which the above-mentioned commit removed :)
      
      Discovered and debugged by Giulio Fedel <giulio.fedel@andorsystems.com>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b5748643
  7. 19 8月, 2007 1 次提交
  8. 18 8月, 2007 1 次提交
  9. 14 8月, 2007 7 次提交
    • S
      [GFS2] Revert remounting w/o acl option leaves acls enabled · d18c4d68
      Steven Whitehouse 提交于
      This reverts commit 569a7b6c. The
      code was correct originally. The default setting for ACLs after a
      remount should be to be the same as before the remount.
      Signed-off-by: NAbhijith Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d18c4d68
    • S
      [GFS2] Fix setting of inherit jdata attr · b9af7ca6
      Steven Whitehouse 提交于
      Due to a mix up between the jdata attribute and inherit jdata attribute
      it has not been possible to set the inherit jdata attribute on
      directories. This is now fixed and the ioctl will report the inherit
      jdata attribute for directories rather than the jdata attribute as it
      did previously. This stems from our need to have the one bit in the
      ioctl attr flags mean two different things according to whether the
      underlying inode is a directory or not.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b9af7ca6
    • S
      [GFS2] Fix incorrect error path in prepare_write() · a867bb28
      Steven Whitehouse 提交于
      The error path in prepare_write() was incorrect in the (very rare) event
      that the transaction fails to start. The following prevents a NULL
      pointer dereference,
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      a867bb28
    • S
      [GFS2] Fix incorrect return code in rgrp.c · 6eefaf61
      Steven Whitehouse 提交于
      The following patch fixes a bug where 0 was being used as a return code
      to indicate "nothing to do" when in fact 0 was a valid block location
      which might be returned by the function.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      6eefaf61
    • B
      [GFS2] soft lockup in rgblk_search · 24c73873
      Bob Peterson 提交于
      This patch seems to fix the problem described in bugzilla bug 246114.
      It was written by Steve Whitehouse with some tweaking by me.
      
      The code was looping in the relatively new section of code designed to
      search for and reuse unlinked inodes.  In cases where it was finding an
      appropriate inode to reuse, it was looping around and finding the same
      block over and over because a "<=" check should have been a "<" when
      comparing the goal block to the last unlinked block found.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      24c73873
    • B
      [GFS2] soft lockup detected in databuf_lo_before_commit · bdcb8856
      Bob Peterson 提交于
      This is part 2 of the patch for bug #245832, part 1 of which is already
      in the git tree.
      
      The problem was that sdp->sd_log_num_databuf was not always being
      protected by the gfs2_log_lock spinlock, but the sd_log_le_databuf
      (which it is supposed to reflect) was protected.  That meant there
      was a timing window during which gfs2_log_flush called
      databuf_lo_before_commit and the count didn't match what was
      really on the linked list in that window.  So when it ran out of
      items on the linked list, it decremented total_dbuf from 0 to -1 and
      thus never left the "while(total_dbuf)" loop.
      
      The solution is to protect the variable sdp->sd_log_num_databuf so
      that the value will always match the contents of the linked list,
      and therefore the number will never go negative, and therefore, the
      loop will be exited properly.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      bdcb8856
    • D
      [DLM] fix basts for granted PR waiting CW · 36509258
      David Teigland 提交于
      Fix a long standing bug where a blocking callback would be missed
      when there's a granted lock in PR mode and waiting locks in both
      PR and CW modes (and the PR lock was added to the waiting queue
      before the CW lock).  The logic simply compared the numerical values
      of the modes to determine if a blocking callback was required, but in
      the one case of PR and CW, the lower valued CW mode blocks the higher
      valued PR mode.  We just need to add a special check for this PR/CW
      case in the tests that decide when a blocking callback is needed.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      36509258