forked from luck/tmp_suning_uos_patched
f2fs-for-5.9-rc5
This introduces some bug fixes including 1) SMR drive fix, 2) infinite loop when building free node ids, 3) EOF at DIO read. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE00UqedjCtOrGVvQiQBSofoJIUNIFAl9Y0skACgkQQBSofoJI UNKggA//a8cCkIx0wp1BEabPQ8x8TrHkiOVZX9zTbiaLkI9MLYweF0YFjbCx/i/t 41r6JbTxWLiM+GRI+u9kOrkBOUgTHAZThIBcWbfYKR5Jz7XdijhsuNYqRf8n33ya u4PtT2AiMW3gt8gJML08eI/U+/rBBpI6fkc8Sza03iTCLjJiWwvZ99h2rPSfgmIw UdyRuof3mPgUz12fQ8BoO/oQ5KhKgA7kxMsCc4UJE9VX/hBYamTfIEF1AmnxlyKn HYhkXyuAmhEFEenBA+ts9YZXMubWHwcj4GlTkWTP6Ib+A3cIinHIqpzEaJnPQdWY JPG72L2TNg0Mtl8w+46zJa1mr6KvXTA5GNowX4OTTf2oHxeHJ4sxax3cmvrDOIfe 7Ga8kGyi5OON1Hymwuyyz4KuKM9zvyUouX0i4wsiamm9kFQoxzNSbfsM5L0weCwM MWVOFhtOUhrQdJ+zpbtJpF8Ijj3nuOoUpw3/hUhl3GM+J4bzE8MdzRmzB3JjkVCr 4mfYuXCITPOH31Fu3obXEFI/9kgyZdxk6OHsXLZCCfRCvgRTDfk5KFQx1OIY3jk0 I/yRjmvnOyD37GVXHyGZxjRplDCgCpTOL6HFk1GOLFUvuoQeOOqwwL0oa/J94ED0 nE80dqs4e8c3/YmUqcgiOm4d4EkdwVzhE9RxdUq7s2SJgh5Eu/o= =gbal -----END PGP SIGNATURE----- Merge tag 'f2fs-for-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs fixes from Jaegeuk Kim: "Small bug fixes for: - SMR drive fix - infinite loop when building free node ids - EOF at DIO read" * tag 'f2fs-for-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: f2fs: Return EOF on unaligned end of file DIO read f2fs: fix indefinite loop scanning for free nid f2fs: Fix type of section block count variables
This commit is contained in:
commit
581cb3a26b
|
@ -3550,6 +3550,9 @@ static int check_direct_IO(struct inode *inode, struct iov_iter *iter,
|
|||
unsigned long align = offset | iov_iter_alignment(iter);
|
||||
struct block_device *bdev = inode->i_sb->s_bdev;
|
||||
|
||||
if (iov_iter_rw(iter) == READ && offset >= i_size_read(inode))
|
||||
return 1;
|
||||
|
||||
if (align & blocksize_mask) {
|
||||
if (bdev)
|
||||
blkbits = blksize_bits(bdev_logical_block_size(bdev));
|
||||
|
|
|
@ -2373,6 +2373,9 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
|
|||
if (unlikely(nid >= nm_i->max_nid))
|
||||
nid = 0;
|
||||
|
||||
if (unlikely(nid % NAT_ENTRY_PER_BLOCK))
|
||||
nid = NAT_BLOCK_OFFSET(nid) * NAT_ENTRY_PER_BLOCK;
|
||||
|
||||
/* Enough entries */
|
||||
if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
|
||||
return 0;
|
||||
|
|
|
@ -799,7 +799,7 @@ static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
|
|||
|
||||
if (__is_large_section(sbi)) {
|
||||
unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
|
||||
unsigned short valid_blocks =
|
||||
block_t valid_blocks =
|
||||
get_valid_blocks(sbi, segno, true);
|
||||
|
||||
f2fs_bug_on(sbi, unlikely(!valid_blocks ||
|
||||
|
@ -815,7 +815,7 @@ static void __remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
|
|||
enum dirty_type dirty_type)
|
||||
{
|
||||
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
|
||||
unsigned short valid_blocks;
|
||||
block_t valid_blocks;
|
||||
|
||||
if (test_and_clear_bit(segno, dirty_i->dirty_segmap[dirty_type]))
|
||||
dirty_i->nr_dirty[dirty_type]--;
|
||||
|
@ -4316,8 +4316,8 @@ static void init_dirty_segmap(struct f2fs_sb_info *sbi)
|
|||
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
|
||||
struct free_segmap_info *free_i = FREE_I(sbi);
|
||||
unsigned int segno = 0, offset = 0, secno;
|
||||
unsigned short valid_blocks;
|
||||
unsigned short blks_per_sec = BLKS_PER_SEC(sbi);
|
||||
block_t valid_blocks;
|
||||
block_t blks_per_sec = BLKS_PER_SEC(sbi);
|
||||
|
||||
while (1) {
|
||||
/* find dirty segment based on free segmap */
|
||||
|
|
Loading…
Reference in New Issue
Block a user