Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
"Miscellaneous bug fixes and cleanups for ext4, including a fix for
generic/388 in data=journal mode, removing some BUG_ON's, and cleaning
up some compiler warnings"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: convert BUG_ON's to WARN_ON's in mballoc.c
ext4: increase wait time needed before reuse of deleted inode numbers
ext4: remove set but not used variable 'es' in ext4_jbd2.c
ext4: remove set but not used variable 'es'
ext4: do not zeroout extents beyond i_disksize
ext4: fix return-value types in several function comments
ext4: use non-movable memory for superblock readahead
ext4: use matching invalidatepage in ext4_writepage

+34 -18
+11
fs/buffer.c
··· 1371 1371 } 1372 1372 EXPORT_SYMBOL(__breadahead); 1373 1373 1374 + void __breadahead_gfp(struct block_device *bdev, sector_t block, unsigned size, 1375 + gfp_t gfp) 1376 + { 1377 + struct buffer_head *bh = __getblk_gfp(bdev, block, size, gfp); 1378 + if (likely(bh)) { 1379 + ll_rw_block(REQ_OP_READ, REQ_RAHEAD, 1, &bh); 1380 + brelse(bh); 1381 + } 1382 + } 1383 + EXPORT_SYMBOL(__breadahead_gfp); 1384 + 1374 1385 /** 1375 1386 * __bread_gfp() - reads a specified block and returns the bh 1376 1387 * @bdev: the block_device to read from
+2 -2
fs/ext4/balloc.c
··· 410 410 * Read the bitmap for a given block_group,and validate the 411 411 * bits for block/inode/inode tables are set in the bitmaps 412 412 * 413 - * Return buffer_head on success or NULL in case of failure. 413 + * Return buffer_head on success or an ERR_PTR in case of failure. 414 414 */ 415 415 struct buffer_head * 416 416 ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) ··· 502 502 return ERR_PTR(err); 503 503 } 504 504 505 - /* Returns 0 on success, 1 on error */ 505 + /* Returns 0 on success, -errno on error */ 506 506 int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group, 507 507 struct buffer_head *bh) 508 508 {
-3
fs/ext4/ext4_jbd2.c
··· 338 338 if (inode && inode_needs_sync(inode)) { 339 339 sync_dirty_buffer(bh); 340 340 if (buffer_req(bh) && !buffer_uptodate(bh)) { 341 - struct ext4_super_block *es; 342 - 343 - es = EXT4_SB(inode->i_sb)->s_es; 344 341 ext4_error_inode_err(inode, where, line, 345 342 bh->b_blocknr, EIO, 346 343 "IO error syncing itable block");
+4 -4
fs/ext4/extents.c
··· 3374 3374 (unsigned long long)map->m_lblk, map_len); 3375 3375 3376 3376 sbi = EXT4_SB(inode->i_sb); 3377 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> 3378 - inode->i_sb->s_blocksize_bits; 3377 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) 3378 + >> inode->i_sb->s_blocksize_bits; 3379 3379 if (eof_block < map->m_lblk + map_len) 3380 3380 eof_block = map->m_lblk + map_len; 3381 3381 ··· 3627 3627 __func__, inode->i_ino, 3628 3628 (unsigned long long)map->m_lblk, map->m_len); 3629 3629 3630 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> 3631 - inode->i_sb->s_blocksize_bits; 3630 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) 3631 + >> inode->i_sb->s_blocksize_bits; 3632 3632 if (eof_block < map->m_lblk + map->m_len) 3633 3633 eof_block = map->m_lblk + map->m_len; 3634 3634 /*
+2 -2
fs/ext4/ialloc.c
··· 113 113 * Read the inode allocation bitmap for a given block_group, reading 114 114 * into the specified slot in the superblock's bitmap cache. 115 115 * 116 - * Return buffer_head of bitmap on success or NULL. 116 + * Return buffer_head of bitmap on success, or an ERR_PTR on error. 117 117 */ 118 118 static struct buffer_head * 119 119 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) ··· 662 662 * block has been written back to disk. (Yes, these values are 663 663 * somewhat arbitrary...) 664 664 */ 665 - #define RECENTCY_MIN 5 665 + #define RECENTCY_MIN 60 666 666 #define RECENTCY_DIRTY 300 667 667 668 668 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)
+2 -2
fs/ext4/inode.c
··· 1973 1973 bool keep_towrite = false; 1974 1974 1975 1975 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) { 1976 - ext4_invalidatepage(page, 0, PAGE_SIZE); 1976 + inode->i_mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE); 1977 1977 unlock_page(page); 1978 1978 return -EIO; 1979 1979 } ··· 4364 4364 if (end > table) 4365 4365 end = table; 4366 4366 while (b <= end) 4367 - sb_breadahead(sb, b++); 4367 + sb_breadahead_unmovable(sb, b++); 4368 4368 } 4369 4369 4370 4370 /*
+4 -2
fs/ext4/mballoc.c
··· 1943 1943 int free; 1944 1944 1945 1945 free = e4b->bd_info->bb_free; 1946 - BUG_ON(free <= 0); 1946 + if (WARN_ON(free <= 0)) 1947 + return; 1947 1948 1948 1949 i = e4b->bd_info->bb_first_free; 1949 1950 ··· 1967 1966 } 1968 1967 1969 1968 mb_find_extent(e4b, i, ac->ac_g_ex.fe_len, &ex); 1970 - BUG_ON(ex.fe_len <= 0); 1969 + if (WARN_ON(ex.fe_len <= 0)) 1970 + break; 1971 1971 if (free < ex.fe_len) { 1972 1972 ext4_grp_locked_error(sb, e4b->bd_group, 0, 0, 1973 1973 "%d free clusters as per "
+1 -3
fs/ext4/super.c
··· 596 596 { 597 597 va_list args; 598 598 struct va_format vaf; 599 - struct ext4_super_block *es; 600 599 struct inode *inode = file_inode(file); 601 600 char pathname[80], *path; 602 601 ··· 603 604 return; 604 605 605 606 trace_ext4_error(inode->i_sb, function, line); 606 - es = EXT4_SB(inode->i_sb)->s_es; 607 607 if (ext4_error_ratelimit(inode->i_sb)) { 608 608 path = file_path(file, pathname, sizeof(pathname)); 609 609 if (IS_ERR(path)) ··· 4338 4340 /* Pre-read the descriptors into the buffer cache */ 4339 4341 for (i = 0; i < db_count; i++) { 4340 4342 block = descriptor_loc(sb, logical_sb_block, i); 4341 - sb_breadahead(sb, block); 4343 + sb_breadahead_unmovable(sb, block); 4342 4344 } 4343 4345 4344 4346 for (i = 0; i < db_count; i++) {
+8
include/linux/buffer_head.h
··· 189 189 void __brelse(struct buffer_head *); 190 190 void __bforget(struct buffer_head *); 191 191 void __breadahead(struct block_device *, sector_t block, unsigned int size); 192 + void __breadahead_gfp(struct block_device *, sector_t block, unsigned int size, 193 + gfp_t gfp); 192 194 struct buffer_head *__bread_gfp(struct block_device *, 193 195 sector_t block, unsigned size, gfp_t gfp); 194 196 void invalidate_bh_lrus(void); ··· 319 317 sb_breadahead(struct super_block *sb, sector_t block) 320 318 { 321 319 __breadahead(sb->s_bdev, block, sb->s_blocksize); 320 + } 321 + 322 + static inline void 323 + sb_breadahead_unmovable(struct super_block *sb, sector_t block) 324 + { 325 + __breadahead_gfp(sb->s_bdev, block, sb->s_blocksize, 0); 322 326 } 323 327 324 328 static inline struct buffer_head *