1. 21 5月, 2011 2 次提交
  2. 19 5月, 2011 3 次提交
  3. 16 5月, 2011 2 次提交
  4. 15 5月, 2011 1 次提交
  5. 10 5月, 2011 4 次提交
  6. 09 5月, 2011 8 次提交
  7. 04 5月, 2011 2 次提交
  8. 03 5月, 2011 4 次提交
  9. 02 5月, 2011 2 次提交
    • T
      jbd2: fix fsync() tid wraparound bug · deeeaf13
      Theodore Ts'o 提交于
      If an application program does not make any changes to the indirect
      blocks or extent tree, i_datasync_tid will not get updated.  If there
      are enough commits (i.e., 2**31) such that tid_geq()'s calculations
      wrap, and there isn't a currently active transaction at the time of
      the fdatasync() call, this can end up triggering a BUG_ON in
      fs/jbd2/commit.c:
      
      	J_ASSERT(journal->j_running_transaction != NULL);
      
      It's pretty rare that this can happen, since it requires the use of
      fdatasync() plus *very* frequent and excessive use of fsync().  But
      with the right workload, it can.
      
      We fix this by replacing the use of tid_geq() with an equality test,
      since there's only one valid transaction id that we is valid for us to
      wait until it is commited: namely, the currently running transaction
      (if it exists).
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      deeeaf13
    • S
      ext4: remove dead code in ext4_has_free_blocks() · dc2070a2
      Shaohua Li 提交于
      percpu_counter_sum_positive() never returns a negative value.
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      dc2070a2
  10. 01 5月, 2011 2 次提交
    • T
      ext4: ignore errors when issuing discards · d9f34504
      Theodore Ts'o 提交于
      This is an effective revert of commit a30eec2a: "ext4: stop issuing
      discards if not supported by device".  The problem is that there are
      some devices that may return errors in response to a discard request
      some times but not others.  (One example would be a hybrid dm device
      which concatenates an SSD and an HDD device).
      
      By this logic, I also removed the error checking from ext4's FITRIM
      code; so that an error from a discard will not stop the FITRIM from
      trying to trim the rest of the file system.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      d9f34504
    • C
      ext4: don't set PageUptodate in ext4_end_bio() · 39db00f1
      Curt Wohlgemuth 提交于
      In the bio completion routine, we should not be setting
      PageUptodate at all -- it's set at sys_write() time, and is
      unaffected by success/failure of the write to disk.
      
      This can cause a page corruption bug when the file system's
      block size is less than the architecture's VM page size.
      
      if we have only written a single block -- we might end up
      setting the page's PageUptodate flag, indicating that page
      is completely read into memory, which may not be true.
      This could cause subsequent reads to get bad data.
      
      This commit also takes the opportunity to clean up error
      handling in ext4_end_bio(), and remove some extraneous code:
      
         - fixes ext4_end_bio() to set AS_EIO in the
           page->mapping->flags on error, which was left out by
           mistake.  This is needed so that fsync() will
           return an error if there was an I/O error.
         - remove the clear_buffer_dirty() call on unmapped
           buffers for each page.
         - consolidate page/buffer error handling in a single
           section.
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reported-by: NJim Meyering <jim@meyering.net>
      Reported-by: NHugh Dickins <hughd@google.com>
      Cc: Mingming Cao <cmm@us.ibm.com>
      39db00f1
  11. 19 4月, 2011 1 次提交
    • T
      ext4: check for ext[23] file system features when mounting as ext[23] · 2035e776
      Theodore Ts'o 提交于
      Provide better emulation for ext[23] mode by enforcing that the file
      system does not have any unsupported file system features as defined
      by ext[23] when emulating the ext[23] file system driver when
      CONFIG_EXT4_USE_FOR_EXT23 is defined.
      
      This causes the file system type information in /proc/mounts to be
      correct for the automatically mounted root file system.  This also
      means that "mount -t ext2 /dev/sda /mnt" will fail if /dev/sda
      contains an ext3 or ext4 file system, just as one would expect if the
      original ext2 file system driver were in use.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      2035e776
  12. 17 4月, 2011 1 次提交
  13. 12 4月, 2011 1 次提交
  14. 11 4月, 2011 5 次提交
    • T
      ext4: fix data corruption regression by reverting commit 6de9843d · c8205636
      Theodore Ts'o 提交于
      Revert commit 6de9843d, since it
      caused a data corruption regression with BitTorrent downloads.  Thanks
      to Damien for discovering and bisecting to find the problem commit.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=32972Reported-by: NDamien Grassart <damien@grassart.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      c8205636
    • K
      ext4: Allow indirect-block file to grow the file size to max file size · f80da1e7
      Kazuya Mio 提交于
      We can create 4402345721856 byte file with indirect block mapping.
      However, if we grow an indirect-block file to the size with ftruncate(),
      we can see an ext4 warning. The following patch fixes this problem.
      
      How to reproduce:
      # dd if=/dev/zero of=/mnt/mp1/hoge bs=1 count=0 seek=4402345721856
      0+0 records in
      0+0 records out
      0 bytes (0 B) copied, 0.000221428 s, 0.0 kB/s
      # tail -n 1 /var/log/messages
      Nov 25 15:10:27 test kernel: EXT4-fs warning (device sda8): ext4_block_to_path:345: block 1074791436 > max in inode 12
      Signed-off-by: NKazuya Mio <k-mio@sx.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      f80da1e7
    • Y
      ext4: allow an active handle to be started when freezing · be4f27d3
      Yongqiang Yang 提交于
      ext4_journal_start_sb() should not prevent an active handle from being
      started due to s_frozen.  Otherwise, deadlock is easy to happen, below
      is a situation.
      
      ================================================
           freeze         |       truncate
      ================================================
                          |  ext4_ext_truncate()
          freeze_super()  |   starts a handle
          sets s_frozen   |
                          |  ext4_ext_truncate()
                          |  holds i_data_sem
        ext4_freeze()     |
        waits for updates |
                          |  ext4_free_blocks()
                          |  calls dquot_free_block()
                          |
                          |  dquot_free_blocks()
                          |  calls ext4_dirty_inode()
                          |
                          |  ext4_dirty_inode()
                          |  trys to start an active
                          |  handle
                          |
                          |  block due to s_frozen
      ================================================
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reported-by: NAmir Goldstein <amir73il@users.sf.net>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NAndreas Dilger <adilger@dilger.ca>
      be4f27d3
    • C
      ext4: sync the directory inode in ext4_sync_parent() · 0893ed45
      Curt Wohlgemuth 提交于
      ext4 has taken the stance that, in the absence of a journal,
      when an fsync/fdatasync of an inode is done, the parent
      directory should be sync'ed if this inode entry is new.
      ext4_sync_parent(), which implements this, does indeed sync
      the dirent pages for parent directories, but it does not
      sync the directory *inode*.  This patch fixes this.
      
      Also now return error status from ext4_sync_parent().
      
      I tested this using a power fail test, which panics a
      machine running a file server getting requests from a
      client.  Without this patch, on about every other test run,
      the server is missing many, many files that had been synced.
      With this patch, on > 6 runs, I see zero files being lost.
      
      Google-Bug-Id: 4179519
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0893ed45
    • J
      nfsd4: fix oops on lock failure · 23fcf2ec
      J. Bruce Fields 提交于
      Lock stateid's can have access_bmap 0 if they were only partially
      initialized (due to a failed lock request); handle that case in
      free_generic_stateid.
      
      ------------[ cut here ]------------
      kernel BUG at fs/nfsd/nfs4state.c:380!
      invalid opcode: 0000 [#1] SMP
      last sysfs file: /sys/kernel/mm/ksm/run
      Modules linked in: nfs fscache md4 nls_utf8 cifs ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat bridge stp llc nfsd lockd nfs_acl auth_rpcgss sunrpc ipv6 ppdev parport_pc parport pcnet32 mii pcspkr microcode i2c_piix4 BusLogic floppy [last unloaded: mperf]
      
      Pid: 1468, comm: nfsd Not tainted 2.6.38+ #120 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
      EIP: 0060:[<e24f180d>] EFLAGS: 00010297 CPU: 0
      EIP is at nfs4_access_to_omode+0x1c/0x29 [nfsd]
      EAX: ffffffff EBX: dd758120 ECX: 00000000 EDX: 00000004
      ESI: dd758120 EDI: ddfe657c EBP: dd54dde0 ESP: dd54dde0
       DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      Process nfsd (pid: 1468, ti=dd54c000 task=ddc92580 task.ti=dd54c000)
      Stack:
       dd54ddf0 e24f19ca 00000000 ddfe6560 dd54de08 e24f1a5d dd758130 deee3a20
       ddfe6560 31270000 dd54df1c e24f52fd 0000000f dd758090 e2505dd0 0be304cf
       dbb51d68 0000000e ddfe657c ddcd8020 dd758130 dd758128 dd7580d8 dd54de68
      Call Trace:
       [<e24f19ca>] free_generic_stateid+0x1c/0x3e [nfsd]
       [<e24f1a5d>] release_lockowner+0x71/0x8a [nfsd]
       [<e24f52fd>] nfsd4_lock+0x617/0x66c [nfsd]
       [<e24e57b6>] ? nfsd_setuser+0x199/0x1bb [nfsd]
       [<e24e056c>] ? nfsd_setuser_and_check_port+0x65/0x81 [nfsd]
       [<c07a0052>] ? _cond_resched+0x8/0x1c
       [<c04ca61f>] ? slab_pre_alloc_hook.clone.33+0x23/0x27
       [<c04cac01>] ? kmem_cache_alloc+0x1a/0xd2
       [<c04835a0>] ? __call_rcu+0xd7/0xdd
       [<e24e0dfb>] ? fh_verify+0x401/0x452 [nfsd]
       [<e24f0b61>] ? nfsd4_encode_operation+0x52/0x117 [nfsd]
       [<e24ea0d7>] ? nfsd4_putfh+0x33/0x3b [nfsd]
       [<e24f4ce6>] ? nfsd4_delegreturn+0xd4/0xd4 [nfsd]
       [<e24ea2c9>] nfsd4_proc_compound+0x1ea/0x33e [nfsd]
       [<e24de6ee>] nfsd_dispatch+0xd1/0x1a5 [nfsd]
       [<e1d6e1c7>] svc_process_common+0x282/0x46f [sunrpc]
       [<e1d6e578>] svc_process+0xdc/0xfa [sunrpc]
       [<e24de0fa>] nfsd+0xd6/0x115 [nfsd]
       [<e24de024>] ? nfsd_shutdown+0x24/0x24 [nfsd]
       [<c0454322>] kthread+0x62/0x67
       [<c04542c0>] ? kthread_worker_fn+0x114/0x114
       [<c07a6ebe>] kernel_thread_helper+0x6/0x10
      Code: eb 05 b8 00 00 27 4f 8d 65 f4 5b 5e 5f 5d c3 83 e0 03 55 83 f8 02 89 e5 74 17 83 f8 03 74 05 48 75 09 eb 09 b8 02 00 00 00 eb 0b <0f> 0b 31 c0 eb 05 b8 01 00 00 00 5d c3 55 89 e5 57 56 89 d6 8d
      EIP: [<e24f180d>] nfs4_access_to_omode+0x1c/0x29 [nfsd] SS:ESP 0068:dd54dde0
      ---[ end trace 2b0bf6c6557cb284 ]---
      
      The trace route is:
      
       -> nfsd4_lock()
         -> if (lock->lk_is_new) {
           -> alloc_init_lock_stateid()
      
              3739: stp->st_access_bmap = 0;
      
         ->if (status && lock->lk_is_new && lock_sop)
           -> release_lockowner()
            -> free_generic_stateid()
             -> nfs4_access_bmap_to_omode()
                -> nfs4_access_to_omode()
      
              380: BUG();   *****
      
      This problem was introduced by 0997b173.
      Reported-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
      Tested-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      23fcf2ec
  15. 08 4月, 2011 2 次提交
    • C
      xfs: use proper interfaces for on-stack plugging · a1b7ea5d
      Christoph Hellwig 提交于
      Add proper blk_start_plug/blk_finish_plug pairs for the two places where
      we issue buffer I/O, and remove the blk_flush_plug in xfs_buf_lock and
      xfs_buf_iowait, given that context switches already flush the per-process
      plugging lists.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      a1b7ea5d
    • C
      xfs: fix xfs_debug warnings · 957935dc
      Christoph Hellwig 提交于
      For a CONFIG_XFS_DEBUG=n build gcc complains about statements with no
      effect in xfs_debug:
      
      fs/xfs/quota/xfs_qm_syscalls.c: In function 'xfs_qm_scall_trunc_qfiles':
      fs/xfs/quota/xfs_qm_syscalls.c:291:3: warning: statement with no effect
      
      The reason for that is that the various new xfs message functions have a
      return value which is never used, and in case of the non-debug build
      xfs_debug the macro evaluates to a plain 0 which produces the above
      warnings.  This can be fixed by turning xfs_debug into an inline function
      instead of a macro, but in addition to that I've also changed all the
      message helpers to return void as we never use their return values.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      957935dc