]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Aug 2022 03:13:46 +0000 (20:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Aug 2022 03:13:46 +0000 (20:13 -0700)
Pull ext4 updates from Ted Ts'o:
 "Add new ioctls to set and get the file system UUID in the ext4
  superblock and improved the performance of the online resizing of file
  systems with bigalloc enabled.

  Fixed a lot of bugs, in particular for the inline data feature,
  potential races when creating and deleting inodes with shared extended
  attribute blocks, and the handling of directory blocks which are
  corrupted"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (37 commits)
  ext4: add ioctls to get/set the ext4 superblock uuid
  ext4: avoid resizing to a partial cluster size
  ext4: reduce computation of overhead during resize
  jbd2: fix assertion 'jh->b_frozen_data == NULL' failure when journal aborted
  ext4: block range must be validated before use in ext4_mb_clear_bb()
  mbcache: automatically delete entries from cache on freeing
  mbcache: Remove mb_cache_entry_delete()
  ext2: avoid deleting xattr block that is being reused
  ext2: unindent codeblock in ext2_xattr_set()
  ext2: factor our freeing of xattr block reference
  ext4: fix race when reusing xattr blocks
  ext4: unindent codeblock in ext4_xattr_block_set()
  ext4: remove EA inode entry from mbcache on inode eviction
  mbcache: add functions to delete entry if unused
  mbcache: don't reclaim used entries
  ext4: make sure ext4_append() always allocates new block
  ext4: check if directory block is within i_size
  ext4: reflect mb_optimize_scan value in options file
  ext4: avoid remove directory when directory is corrupted
  ext4: aligned '*' in comments
  ...

1  2 
fs/ext4/ext4.h
fs/ext4/fast_commit.c
fs/ext4/inode.c
fs/ext4/super.c
fs/jbd2/commit.c
fs/jbd2/journal.c
fs/jbd2/recovery.c
include/linux/jbd2.h

diff --cc fs/ext4/ext4.h
Simple merge
Simple merge
diff --cc fs/ext4/inode.c
index 9fd60fc8ba4c8c18640f82730bbefea1c1be126f,8204c59bdd1df40b2be340203f6b08564c776b40..601214453c3aec9163289c70c58426a40cdfb024
@@@ -1571,21 -1573,25 +1573,28 @@@ static void mpage_release_unused_pages(
                ext4_lblk_t start, last;
                start = index << (PAGE_SHIFT - inode->i_blkbits);
                last = end << (PAGE_SHIFT - inode->i_blkbits);
+               /*
+                * avoid racing with extent status tree scans made by
+                * ext4_insert_delayed_block()
+                */
+               down_write(&EXT4_I(inode)->i_data_sem);
                ext4_es_remove_extent(inode, start, last - start + 1);
+               up_write(&EXT4_I(inode)->i_data_sem);
        }
  
 -      pagevec_init(&pvec);
 +      folio_batch_init(&fbatch);
        while (index <= end) {
 -              nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end);
 -              if (nr_pages == 0)
 +              nr = filemap_get_folios(mapping, &index, end, &fbatch);
 +              if (nr == 0)
                        break;
 -              for (i = 0; i < nr_pages; i++) {
 -                      struct page *page = pvec.pages[i];
 -                      struct folio *folio = page_folio(page);
 +              for (i = 0; i < nr; i++) {
 +                      struct folio *folio = fbatch.folios[i];
  
 +                      if (folio->index < mpd->first_page)
 +                              continue;
 +                      if (folio->index + folio_nr_pages(folio) - 1 > end)
 +                              continue;
                        BUG_ON(!folio_test_locked(folio));
                        BUG_ON(folio_test_writeback(folio));
                        if (invalidate) {
diff --cc fs/ext4/super.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge