1. 06 8月, 2012 1 次提交
    • T
      ext4: make sure the journal sb is written in ext4_clear_journal_err() · d796c52e
      Theodore Ts'o 提交于
      After we transfer set the EXT4_ERROR_FS bit in the file system
      superblock, it's not enough to call jbd2_journal_clear_err() to clear
      the error indication from journal superblock --- we need to call
      jbd2_journal_update_sb_errno() as well.  Otherwise, when the root file
      system is mounted read-only, the journal is replayed, and the error
      indicator is transferred to the superblock --- but the s_errno field
      in the jbd2 superblock is left set (since although we cleared it in
      memory, we never flushed it out to disk).
      
      This can end up confusing e2fsck.  We should make e2fsck more robust
      in this case, but the kernel shouldn't be leaving things in this
      confused state, either.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      
      d796c52e
  2. 31 7月, 2012 1 次提交
  3. 23 7月, 2012 4 次提交
    • A
      ext4: weed out ext4_write_super · 4d47603d
      Artem Bityutskiy 提交于
      We do not depend on VFS's '->write_super()' anymore and do not need
      the 's_dirt' flag anymore, so weed out 'ext4_write_super()' and
      's_dirt'.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: NJan Kara <jack@suse.cz>
      4d47603d
    • A
      ext4: remove unnecessary superblock dirtying · 58c5873a
      Artem Bityutskiy 提交于
      This patch changes the 'ext4_handle_dirty_super()' function which
      submits the superblock for I/O in the following cases:
      
      1. When creating the first large file on a file system without
         EXT4_FEATURE_RO_COMPAT_LARGE_FILE feature.
      2. When re-sizing the file-system.
      3. When creating an xattr on a file-system without the
         EXT4_FEATURE_COMPAT_EXT_ATTR feature.
      
      If the file-system has journal enabled, the superblock is written via
      the journal. We do not modify this path.
      
      If the file-system has no journal, this function, falls back to just
      marking the superblock as dirty using the 's_dirt' superblock
      flag. This means that it delays the actual superblock I/O submission
      by 5 seconds (default setting).  Namely, the 'sync_supers()' kernel
      thread will call 'ext4_write_super()' later and will actually submit
      the superblock for I/O.
      
      And this is the behavior this patch modifies: we stop using 's_dirt'
      and just mark the superblock buffer as dirty right away. Indeed, all 3
      cases above are extremely rare and it does not add any value to delay
      the I/O submission for them.
      
      Note: 'ext4_handle_dirty_super()' executes
      '__ext4_handle_dirty_super()' with 'now = 0'. This patch basically
      makes the 'now' argument unneeded and it will be deleted in one of the
      next patches.
      
      This patch also removes 's_dirt' condition on the unmount path because
      we never set it anymore, so we should not test it.
      
      Tested using xfstests for both journalled and non-journalled ext4.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: NJan Kara <jack@suse.cz>
      58c5873a
    • A
      ext4: make quota as first class supported feature · 7c319d32
      Aditya Kali 提交于
      This patch adds support for quotas as a first class feature in ext4;
      which is to say, the quota files are stored in hidden inodes as file
      system metadata, instead of as separate files visible in the file system
      directory hierarchy.
      
      It is based on the proposal at:                                                                                                           
      https://ext4.wiki.kernel.org/index.php/Design_For_1st_Class_Quota_in_Ext4
      
      This patch introduces a new feature - EXT4_FEATURE_RO_COMPAT_QUOTA
      which, when turned on, enables quota accounting at mount time
      iteself. Also, the quota inodes are stored in two additional superblock
      fields.  Some changes introduced by this patch that should be pointed
      out are:
      
      1) Two new ext4-superblock fields - s_usr_quota_inum and
         s_grp_quota_inum for storing the quota inodes in use.
      2) Default quota inodes are: inode#3 for tracking userquota and inode#4
         for tracking group quota. The superblock fields can be set to use
         other inodes as well.
      3) If the QUOTA feature and corresponding quota inodes are set in
         superblock, the quota usage tracking is turned on at mount time. On
         'quotaon' ioctl, the quota limits enforcement is turned
         on. 'quotaoff' ioctl turns off only the limits enforcement in this
         case.
      4) When QUOTA feature is in use, the quota mount options 'quota',
         'usrquota', 'grpquota' are ignored by the kernel.
      5) mke2fs or tune2fs can be used to set the QUOTA feature and initialize
         quota inodes. The default reserved inodes will not be visible to user
         as regular files.
      6) The quota-tools will need to be modified to support hidden quota
         files on ext4. E2fsprogs will also include support for creating and
         fixing quota files.
      7) Support is only for the new V2 quota file format.
      Tested-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NJohann Lombardi <johann@whamcloud.com>
      Signed-off-by: NAditya Kali <adityakali@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      7c319d32
    • J
      quota: Move quota syncing to ->sync_fs method · a1177825
      Jan Kara 提交于
      Since the moment writes to quota files are using block device page cache and
      space for quota structures is reserved at the moment they are first accessed we
      have no reason to sync quota before inode writeback. In fact this order is now
      only harmful since quota information can easily change during inode writeback
      (either because conversion of delayed-allocated extents or simply because of
      allocation of new blocks for simple filesystems not using page_mkwrite).
      
      So move syncing of quota information after writeback of inodes into ->sync_fs
      method. This way we do not have to use ->quota_sync callback which is primarily
      intended for use by quotactl syscall anyway and we get rid of calling
      ->sync_fs() twice unnecessarily. We skip quota syncing for OCFS2 since it does
      proper quota journalling in all cases (unlike ext3, ext4, and reiserfs which
      also support legacy non-journalled quotas) and thus there are no dirty quota
      structures.
      
      CC: "Theodore Ts'o" <tytso@mit.edu>
      CC: Joel Becker <jlbec@evilplan.org>
      CC: reiserfs-devel@vger.kernel.org
      Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
      Acked-by: NDave Kleikamp <shaggy@kernel.org>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a1177825
  4. 10 7月, 2012 1 次提交
    • T
      ext4: fix overhead calculation used by ext4_statfs() · 952fc18e
      Theodore Ts'o 提交于
      Commit f975d6bc introduced bug which caused ext4_statfs() to
      miscalculate the number of file system overhead blocks.  This causes
      the f_blocks field in the statfs structure to be larger than it should
      be.  This would in turn cause the "df" output to show the number of
      data blocks in the file system and the number of data blocks used to
      be larger than they should be.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      952fc18e
  5. 31 5月, 2012 2 次提交
  6. 29 5月, 2012 4 次提交
  7. 27 5月, 2012 1 次提交
  8. 21 5月, 2012 1 次提交
    • T
      ext4: enable the 64-bit jbd2 feature based on the 64-bit ext4 feature · f32aaf2d
      Theodore Ts'o 提交于
      Previously we were only enabling the 64-bit jbd2 feature if the number
      of blocks in the file system was greater 2**32-1.  The problem with
      this is that it makes it harder to test the 64-bit journal code paths
      with small file systems, since a small test file system would with the
      64-bit ext4 feature enable would use a 64-bit file system on-disk data
      structures, but use a 32-bit journal.
      
      This would also cause problems when trying to do an online resize to
      grow the filesystem above the 2**32-1 boundary.  Fortunately the patch
      to support online resize for 64-bit file systems hasn't been merged
      yet, so this problem hasn't arisen in practice.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      f32aaf2d
  9. 16 5月, 2012 2 次提交
  10. 06 5月, 2012 1 次提交
  11. 30 4月, 2012 4 次提交
  12. 24 4月, 2012 1 次提交
  13. 17 4月, 2012 2 次提交
  14. 22 3月, 2012 2 次提交
  15. 21 3月, 2012 2 次提交
  16. 20 3月, 2012 2 次提交
  17. 05 3月, 2012 4 次提交
  18. 04 3月, 2012 4 次提交
  19. 03 3月, 2012 1 次提交