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 'xfs-4.15-fixes-10' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull XFS fixes from Darrick Wong:
"I have just a few fixes for bugs and resource cleanup problems this
week:

- Fix resource cleanup of failed quota initialization

- Fix integer overflow problems wrt s_maxbytes"

* tag 'xfs-4.15-fixes-10' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: fix s_maxbytes overflow problems
xfs: quota: check result of register_shrinker()
xfs: quota: fix missed destroy of qi_tree_lock

+33 -19
+2 -2
fs/xfs/xfs_aops.c
··· 399 399 (ip->i_df.if_flags & XFS_IFEXTENTS)); 400 400 ASSERT(offset <= mp->m_super->s_maxbytes); 401 401 402 - if ((xfs_ufsize_t)offset + count > mp->m_super->s_maxbytes) 402 + if (offset > mp->m_super->s_maxbytes - count) 403 403 count = mp->m_super->s_maxbytes - offset; 404 404 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count); 405 405 offset_fsb = XFS_B_TO_FSBT(mp, offset); ··· 1312 1312 lockmode = xfs_ilock_data_map_shared(ip); 1313 1313 1314 1314 ASSERT(offset <= mp->m_super->s_maxbytes); 1315 - if ((xfs_ufsize_t)offset + size > mp->m_super->s_maxbytes) 1315 + if (offset > mp->m_super->s_maxbytes - size) 1316 1316 size = mp->m_super->s_maxbytes - offset; 1317 1317 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + size); 1318 1318 offset_fsb = XFS_B_TO_FSBT(mp, offset);
+1 -1
fs/xfs/xfs_iomap.c
··· 1006 1006 } 1007 1007 1008 1008 ASSERT(offset <= mp->m_super->s_maxbytes); 1009 - if ((xfs_fsize_t)offset + length > mp->m_super->s_maxbytes) 1009 + if (offset > mp->m_super->s_maxbytes - length) 1010 1010 length = mp->m_super->s_maxbytes - offset; 1011 1011 offset_fsb = XFS_B_TO_FSBT(mp, offset); 1012 1012 end_fsb = XFS_B_TO_FSB(mp, offset + length);
+30 -16
fs/xfs/xfs_qm.c
··· 48 48 STATIC int xfs_qm_init_quotainos(xfs_mount_t *); 49 49 STATIC int xfs_qm_init_quotainfo(xfs_mount_t *); 50 50 51 - 51 + STATIC void xfs_qm_destroy_quotainos(xfs_quotainfo_t *qi); 52 52 STATIC void xfs_qm_dqfree_one(struct xfs_dquot *dqp); 53 53 /* 54 54 * We use the batch lookup interface to iterate over the dquots as it ··· 695 695 qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan; 696 696 qinf->qi_shrinker.seeks = DEFAULT_SEEKS; 697 697 qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE; 698 - register_shrinker(&qinf->qi_shrinker); 698 + 699 + error = register_shrinker(&qinf->qi_shrinker); 700 + if (error) 701 + goto out_free_inos; 702 + 699 703 return 0; 700 704 705 + out_free_inos: 706 + mutex_destroy(&qinf->qi_quotaofflock); 707 + mutex_destroy(&qinf->qi_tree_lock); 708 + xfs_qm_destroy_quotainos(qinf); 701 709 out_free_lru: 702 710 list_lru_destroy(&qinf->qi_lru); 703 711 out_free_qinf: ··· 713 705 mp->m_quotainfo = NULL; 714 706 return error; 715 707 } 716 - 717 708 718 709 /* 719 710 * Gets called when unmounting a filesystem or when all quotas get ··· 730 723 731 724 unregister_shrinker(&qi->qi_shrinker); 732 725 list_lru_destroy(&qi->qi_lru); 733 - 734 - if (qi->qi_uquotaip) { 735 - IRELE(qi->qi_uquotaip); 736 - qi->qi_uquotaip = NULL; /* paranoia */ 737 - } 738 - if (qi->qi_gquotaip) { 739 - IRELE(qi->qi_gquotaip); 740 - qi->qi_gquotaip = NULL; 741 - } 742 - if (qi->qi_pquotaip) { 743 - IRELE(qi->qi_pquotaip); 744 - qi->qi_pquotaip = NULL; 745 - } 726 + xfs_qm_destroy_quotainos(qi); 727 + mutex_destroy(&qi->qi_tree_lock); 746 728 mutex_destroy(&qi->qi_quotaofflock); 747 729 kmem_free(qi); 748 730 mp->m_quotainfo = NULL; ··· 1593 1597 if (pip) 1594 1598 IRELE(pip); 1595 1599 return error; 1600 + } 1601 + 1602 + STATIC void 1603 + xfs_qm_destroy_quotainos( 1604 + xfs_quotainfo_t *qi) 1605 + { 1606 + if (qi->qi_uquotaip) { 1607 + IRELE(qi->qi_uquotaip); 1608 + qi->qi_uquotaip = NULL; /* paranoia */ 1609 + } 1610 + if (qi->qi_gquotaip) { 1611 + IRELE(qi->qi_gquotaip); 1612 + qi->qi_gquotaip = NULL; 1613 + } 1614 + if (qi->qi_pquotaip) { 1615 + IRELE(qi->qi_pquotaip); 1616 + qi->qi_pquotaip = NULL; 1617 + } 1596 1618 } 1597 1619 1598 1620 STATIC void