1. 05 3月, 2010 8 次提交
  2. 23 12月, 2009 5 次提交
  3. 17 12月, 2009 1 次提交
    • C
      sanitize xattr handler prototypes · 431547b3
      Christoph Hellwig 提交于
      Add a flags argument to struct xattr_handler and pass it to all xattr
      handler methods.  This allows using the same methods for multiple
      handlers, e.g. for the ACL methods which perform exactly the same action
      for the access and default ACLs, just using a different underlying
      attribute.  With a little more groundwork it'll also allow sharing the
      methods for the regular user/trusted/secure handlers in extN, ocfs2 and
      jffs2 like it's already done for xfs in this patch.
      
      Also change the inode argument to the handlers to a dentry to allow
      using the handlers mechnism for filesystems that require it later,
      e.g. cifs.
      
      [with GFS2 bits updated by Steven Whitehouse <swhiteho@redhat.com>]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NJames Morris <jmorris@namei.org>
      Acked-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      431547b3
  4. 10 12月, 2009 7 次提交
    • R
      ext3: PTR_ERR return of wrong pointer in setup_new_group_blocks() · 8e0eb401
      Roel Kluin 提交于
      Return the PTR_ERR of the correct pointer.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      8e0eb401
    • J
      ext3: Fix data / filesystem corruption when write fails to copy data · 68eb3db0
      Jan Kara 提交于
      When ext3_write_begin fails after allocating some blocks or
      generic_perform_write fails to copy data to write, we truncate blocks already
      instantiated beyond i_size. Although these blocks were never inside i_size, we
      have to truncate pagecache of these blocks so that corresponding buffers get
      unmapped. Otherwise subsequent __block_prepare_write (called because we are
      retrying the write) will find the buffers mapped, not call ->get_block, and
      thus the page will be backed by already freed blocks leading to filesystem and
      data corruption.
      Reported-by: NJames Y Knight <foom@fuhm.net>
      Signed-off-by: NJan Kara <jack@suse.cz>
      68eb3db0
    • J
      ext3: Support for vfsv1 quota format · 1aeec434
      Jan Kara 提交于
      We just have to add proper mount options handling. The rest is handled by
      the generic quota code.
      
      CC: linux-ext4@vger.kernel.org
      Signed-off-by: NJan Kara <jack@suse.cz>
      1aeec434
    • A
      ext3: Unify log messages in ext3 · 4cf46b67
      Alexey Fisher 提交于
      Make messages produced by ext3 more unified. It should be
      easy to parse.
      
      dmesg before patch:
      [ 4893.684892] reservations ON
      [ 4893.684896] xip option not supported
      [ 4893.684964] EXT3-fs warning: maximal mount count reached, running
      e2fsck is recommended
      
      dmesg after patch:
      [  873.300792] EXT3-fs (loop0): using internal journaln
      [  873.300796] EXT3-fs (loop0): mounted filesystem with writeback data mode
      [  924.163657] EXT3-fs (loop0): error: can't find ext3 filesystem on dev loop0.
      [  723.755642] EXT3-fs (loop0): error: bad blocksize 8192
      [  357.874687] EXT3-fs (loop0): error: no journal found. mounting ext3 over ext2?
      [  873.300764] EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
      [  924.163657] EXT3-fs (loop0): error: can't find ext3 filesystem on dev loop0.
      Signed-off-by: NAlexey Fisher <bug-track@fisher-privat.net>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4cf46b67
    • E
      ext3: make "norecovery" an alias for "noload" · dee1d3b6
      Eric Sandeen 提交于
      Users on the list recently complained about differences across
      filesystems w.r.t. how to mount without a journal replay.
      
      In the discussion it was noted that xfs's "norecovery" option is
      perhaps more descriptively accurate than "noload," so let's make
      that an alias for ext3.
      
      Also show this status in /proc/mounts
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      dee1d3b6
    • E
      ext3: Don't update the superblock in ext3_statfs() · b9183975
      Eric Sandeen 提交于
      commit a71ce8c6 updated ext3_statfs()
      to update the on-disk superblock counters, but modified this buffer
      directly without any journaling of the change.  This is one of the
      accesses that was causing the crc errors in journal replay as seen in
      kernel.org bugzilla #14354.
      
      The modifications were originally to keep the sb "more" in sync,
      so that a readonly fsck of the device didn't flag this as an
      error (as often), but apparently e2fsprogs deals with this differently
      now, anyway.
      
      Based on Ted's patch for ext4, which was in turn based on my
      work on that bug and another preliminary patch...
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b9183975
    • E
      ext3: journal all modifications in ext3_xattr_set_handle · d965736b
      Eric Sandeen 提交于
      ext3_xattr_set_handle() was zeroing out an inode outside
      of journaling constraints; this is one of the accesses that
      was causing the crc errors in journal replay as seen in
      kernel.org bugzilla #14354.
      
      Although ext3 doesn't have the crc issue, modifications
      out of journal control are a Bad Thing.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      d965736b
  5. 04 12月, 2009 1 次提交
  6. 11 11月, 2009 2 次提交
  7. 13 10月, 2009 1 次提交
  8. 22 9月, 2009 2 次提交
  9. 16 9月, 2009 4 次提交
    • J
      ext3: Flush disk caches on fsync when needed · 56fcad29
      Jan Kara 提交于
      In case we fsync() a file and inode is not dirty, we don't force a transaction
      to disk and hence don't flush disk caches. Thus file data could be just in disk
      caches and not on persistent storage. Fix the problem by flushing disk caches
      if we didn't force a transaction commit.
      Signed-off-by: NJan Kara <jack@suse.cz>
      56fcad29
    • C
      ext3: Add locking to ext3_do_update_inode · 4f003fd3
      Chris Mason 提交于
      I've been struggling with this off and on while I've been testing the
      data=guarded work.  The symptom is corrupted orphan lists and inodes
      with the wrong i_size stored on disk.  I was convinced the
      data=guarded code was just missing a call to ext3_mark_inode_dirty, but
      tracing showed the i_disksize I was sending to ext3_mark_inode_dirty
      wasn't actually making it to the drive.
      
      ext3_mark_inode_dirty can be called without locks held (atime updates
      and a few others), so the data=guarded code uses locks while updating
      the in-memory inode, and then calls ext3_mark_inode_dirty
      without any locks held.
      
      But, ext3_mark_inode_dirty has no internal locking to make sure that
      only one CPU is updating the buffer head at a time.  Generally this
      works out ok because everyone that changes the inode then calls
      ext3_mark_inode_dirty themselves.  Even though it races, eventually
      someone updates the buffer heads and things move on.
      
      But there is still a risk of the wrong values getting in, and the
      data=guarded code seems to hit the race very often.
      
      Since everyone that changes the inode also logs it, it should be
      possible to fix this with some memory barriers.  I'll leave that as an
      exercise to the reader and lock the buffer head instead.
      
      It it probably a good idea to have a different patch series for lockless
      bit flipping on the ext3 i_state field.  ext3_do_update_inode &= clears
      EXT3_STATE_NEW without any locks held.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4f003fd3
    • J
      ext3: Fix possible deadlock between ext3_truncate() and ext3_get_blocks() · 00171d3c
      Jan Kara 提交于
      During truncate we are sometimes forced to start a new transaction as the
      amount of blocks to be journaled is both quite large and hard to predict. So
      far we restarted a transaction while holding truncate_mutex and that violates
      lock ordering because truncate_mutex ranks below transaction start (and it
      can lead to a real deadlock with ext3_get_blocks() allocating new blocks
      from ext3_writepage()).
      
      Luckily, the problem is easy to fix: We just drop the truncate_mutex before
      restarting the transaction and acquire it afterwards. We are safe to do this as
      by the time ext3_truncate() is called, all the page cache for the truncated
      part of the file is dropped and so writepage() cannot come and allocate new
      blocks in the part of the file we are truncating. The rest of writers is
      stopped by us holding i_mutex.
      Signed-off-by: NJan Kara <jack@suse.cz>
      00171d3c
    • A
      HWPOISON: Enable .remove_error_page for migration aware file systems · aa261f54
      Andi Kleen 提交于
      Enable removing of corrupted pages through truncation
      for a bunch of file systems: ext*, xfs, gfs2, ocfs2, ntfs
      These should cover most server needs.
      
      I chose the set of migration aware file systems for this
      for now, assuming they have been especially audited.
      But in general it should be safe for all file systems
      on the data area that support read/write and truncate.
      
      Caveat: the hardware error handler does not take i_mutex
      for now before calling the truncate function. Is that ok?
      
      Cc: tytso@mit.edu
      Cc: hch@infradead.org
      Cc: mfasheh@suse.com
      Cc: aia21@cantab.net
      Cc: hugh.dickins@tiscali.co.uk
      Cc: swhiteho@redhat.com
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      aa261f54
  10. 14 9月, 2009 1 次提交
  11. 09 9月, 2009 1 次提交
  12. 24 8月, 2009 2 次提交
    • J
      ext3: Improve error message that changing journaling mode on remount is not possible · 3c4cec65
      Jan Kara 提交于
      This patch makes the error message about changing journaling mode on remount
      more descriptive. Some people are going to hit this error now due to commit
      bbae8bcc if they configure a kernel to default
      to data=writeback mode. The problem happens if they have data=ordered set for
      the root filesystem in /etc/fstab but not in the kernel command line (and they
      don't use initrd). Their filesystem then gets mounted as data=writeback by
      kernel but then their boot fails because init scripts won't be able to remount
      the filesystem rw. Better error message will hopefully make it easier for them
      to find the error in their setup and bother us less with error reports :).
      Signed-off-by: NJan Kara <jack@suse.cz>
      3c4cec65
    • T
      ext3: Update Kconfig description of EXT3_DEFAULTS_TO_ORDERED · 6d418076
      Theodore Ts'o 提交于
      The old description for this configuration option was perhaps not
      completely balanced in terms of describing the tradeoffs of using a
      default of data=writeback vs. data=ordered.  Despite the fact that old
      description very strongly recomended disabling this feature, all of
      the major distributions have elected to preserve the existing 'legacy'
      default, which is a strong hint that it perhaps wasn't telling the
      whole story.
      
      This revised description has been vetted by a number of ext3
      developers as being better at informing the user about the tradeoffs
      of enabling or disabling this configuration feature.
      
      Cc: linux-ext4@vger.kernel.org
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NJan Kara <jack@suse.cz>
      6d418076
  13. 16 7月, 2009 2 次提交
    • J
      ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle() · 43237b54
      Jan Kara 提交于
      Get rid of extenddisksize parameter of ext3_get_blocks_handle(). This seems to
      be a relict from some old days and setting disksize in this function does not
      make much sence. Currently it was set only by ext3_getblk().  Since the
      parameter has some effect only if create == 1, it is easy to check that the
      three callers which end up calling ext3_getblk() with create == 1 (ext3_append,
      ext3_quota_write, ext3_mkdir) do the right thing and set disksize themselves.
      Signed-off-by: NJan Kara <jack@suse.cz>
      43237b54
    • J
      ext3: Fix truncation of symlinks after failed write · 9eaaa2d5
      Jan Kara 提交于
      Contents of long symlinks is written via standard write methods. So when the
      write fails, we add inode to orphan list. But symlinks don't have .truncate
      method defined so nobody properly removes them from the orphan list (both on
      disk and in memory).
      
      Fix this by calling ext3_truncate() directly instead of calling vmtruncate()
      (which is saner anyway since we don't need anything vmtruncate() does except
      from calling .truncate in these paths).  We also add inode to orphan list only
      if ext3_can_truncate() is true (currently, it can be false for symlinks when
      there are no blocks allocated) - otherwise orphan list processing will complain
      and ext3_truncate() will not remove inode from on-disk orphan list.
      Signed-off-by: NJan Kara <jack@suse.cz>
      9eaaa2d5
  14. 24 6月, 2009 2 次提交
  15. 19 6月, 2009 1 次提交