[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202101170343.N74p02P6-lkp@intel.com>
Date: Sun, 17 Jan 2021 03:19:54 +0800
From: kernel test robot <lkp@...el.com>
To: "Darrick J. Wong" <darrick.wong@...cle.com>
Cc: kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
linux-kernel@...r.kernel.org,
Chandan Babu R <chandanrlinux@...il.com>
Subject: fs/xfs/xfs_rtalloc.c:898:1: warning: stack frame size of 1056 bytes
in function 'xfs_growfs_rt'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1d94330a437a573cfdf848f6743b1ed169242c8a
commit: f4c32e87de7d66074d5612567c5eac7325024428 xfs: fix realtime bitmap/summary file truncation when growing rt volume
date: 3 months ago
config: mips-randconfig-r023-20210116 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project d7bc3b7ce23b664d6620cdc32370a8614523ca2f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4c32e87de7d66074d5612567c5eac7325024428
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout f4c32e87de7d66074d5612567c5eac7325024428
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> fs/xfs/xfs_rtalloc.c:898:1: warning: stack frame size of 1056 bytes in function 'xfs_growfs_rt' [-Wframe-larger-than=]
xfs_growfs_rt(
^
1 warning generated.
vim +/xfs_growfs_rt +898 fs/xfs/xfs_rtalloc.c
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 889
^1da177e4c3f4152 Linus Torvalds 2005-04-16 890 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 891 * Visible (exported) functions.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 892 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 893
^1da177e4c3f4152 Linus Torvalds 2005-04-16 894 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 895 * Grow the realtime area of the filesystem.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 896 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 897 int
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @898 xfs_growfs_rt(
^1da177e4c3f4152 Linus Torvalds 2005-04-16 899 xfs_mount_t *mp, /* mount point for filesystem */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 900 xfs_growfs_rt_t *in) /* growfs rt input struct */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 901 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 902 xfs_rtblock_t bmbno; /* bitmap block number */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 903 xfs_buf_t *bp; /* temporary buffer */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 904 int error; /* error return value */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 905 xfs_mount_t *nmp; /* new (fake) mount structure */
d5cf09baced0ef3d Christoph Hellwig 2014-07-30 906 xfs_rfsblock_t nrblocks; /* new number of realtime blocks */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 907 xfs_extlen_t nrbmblocks; /* new number of rt bitmap blocks */
d5cf09baced0ef3d Christoph Hellwig 2014-07-30 908 xfs_rtblock_t nrextents; /* new number of realtime extents */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 909 uint8_t nrextslog; /* new log2 of sb_rextents */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 910 xfs_extlen_t nrsumblocks; /* new number of summary blocks */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 911 uint nrsumlevels; /* new rt summary levels */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 912 uint nrsumsize; /* new size of rt summary, bytes */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 913 xfs_sb_t *nsbp; /* new superblock */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 914 xfs_extlen_t rbmblocks; /* current number of rt bitmap blocks */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 915 xfs_extlen_t rsumblocks; /* current number of rt summary blks */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 916 xfs_sb_t *sbp; /* old superblock */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 917 xfs_fsblock_t sumbno; /* summary block number */
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 918 uint8_t *rsum_cache; /* old summary cache */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 919
^1da177e4c3f4152 Linus Torvalds 2005-04-16 920 sbp = &mp->m_sb;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 921 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 922 * Initial error checking.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 923 */
743bb4650da9e259 sandeen@...deen.net 2008-11-25 924 if (!capable(CAP_SYS_ADMIN))
2451337dd043901b Dave Chinner 2014-06-25 925 return -EPERM;
73024cf11522c023 Eric Sesterhenn 2006-06-28 926 if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL ||
^1da177e4c3f4152 Linus Torvalds 2005-04-16 927 (nrblocks = in->newblocks) <= sbp->sb_rblocks ||
^1da177e4c3f4152 Linus Torvalds 2005-04-16 928 (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize)))
2451337dd043901b Dave Chinner 2014-06-25 929 return -EINVAL;
4cc929ee305c6957 Nathan Scott 2007-05-14 930 if ((error = xfs_sb_validate_fsb_count(sbp, nrblocks)))
4cc929ee305c6957 Nathan Scott 2007-05-14 931 return error;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 932 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 933 * Read in the last block of the device, make sure it exists.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 934 */
ba3726742c1712c4 Dave Chinner 2014-10-02 935 error = xfs_buf_read_uncached(mp->m_rtdev_targp,
4cc929ee305c6957 Nathan Scott 2007-05-14 936 XFS_FSB_TO_BB(mp, nrblocks - 1),
ba3726742c1712c4 Dave Chinner 2014-10-02 937 XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL);
ba3726742c1712c4 Dave Chinner 2014-10-02 938 if (error)
eab4e63368b4cfa5 Dave Chinner 2012-11-12 939 return error;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 940 xfs_buf_relse(bp);
1922c949c59f93be Dave Chinner 2010-09-22 941
^1da177e4c3f4152 Linus Torvalds 2005-04-16 942 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 943 * Calculate new parameters. These are the final values to be reached.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 944 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 945 nrextents = nrblocks;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 946 do_div(nrextents, in->extsize);
68c3271515f11f66 Nathan Scott 2006-09-28 947 nrbmblocks = howmany_64(nrextents, NBBY * sbp->sb_blocksize);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 948 nrextslog = xfs_highbit32(nrextents);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 949 nrsumlevels = nrextslog + 1;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 950 nrsumsize = (uint)sizeof(xfs_suminfo_t) * nrsumlevels * nrbmblocks;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 951 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 952 nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 953 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 954 * New summary size can't be more than half the size of
^1da177e4c3f4152 Linus Torvalds 2005-04-16 955 * the log. This prevents us from getting a log overflow,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 956 * since we'll log basically the whole summary file at once.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 957 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 958 if (nrsumblocks > (mp->m_sb.sb_logblocks >> 1))
2451337dd043901b Dave Chinner 2014-06-25 959 return -EINVAL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 960 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 961 * Get the old block counts for bitmap and summary inodes.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 962 * These can't change since other growfs callers are locked out.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 963 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 964 rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_d.di_size);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 965 rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_d.di_size);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 966 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 967 * Allocate space to the bitmap and summary files, as necessary.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 968 */
1050c71e2925ab0c Christoph Hellwig 2011-02-13 969 error = xfs_growfs_rt_alloc(mp, rbmblocks, nrbmblocks, mp->m_rbmip);
1050c71e2925ab0c Christoph Hellwig 2011-02-13 970 if (error)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 971 return error;
1050c71e2925ab0c Christoph Hellwig 2011-02-13 972 error = xfs_growfs_rt_alloc(mp, rsumblocks, nrsumblocks, mp->m_rsumip);
1050c71e2925ab0c Christoph Hellwig 2011-02-13 973 if (error)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 974 return error;
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 975
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 976 rsum_cache = mp->m_rsum_cache;
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 977 if (nrbmblocks != sbp->sb_rbmblocks)
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 978 xfs_alloc_rsum_cache(mp, nrbmblocks);
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 979
d432c80e68e3c283 Nathan Scott 2006-09-28 980 /*
d432c80e68e3c283 Nathan Scott 2006-09-28 981 * Allocate a new (fake) mount/sb.
d432c80e68e3c283 Nathan Scott 2006-09-28 982 */
707e0ddaf67e8942 Tetsuo Handa 2019-08-26 983 nmp = kmem_alloc(sizeof(*nmp), 0);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 984 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 985 * Loop over the bitmap blocks.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 986 * We will do everything one bitmap block at a time.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 987 * Skip the current block if it is exactly full.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 988 * This also deals with the case where there were no rtextents before.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 989 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 990 for (bmbno = sbp->sb_rbmblocks -
^1da177e4c3f4152 Linus Torvalds 2005-04-16 991 ((sbp->sb_rextents & ((1 << mp->m_blkbit_log) - 1)) != 0);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 992 bmbno < nrbmblocks;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 993 bmbno++) {
0924b585fc49bf37 Dave Chinner 2008-11-28 994 xfs_trans_t *tp;
0924b585fc49bf37 Dave Chinner 2008-11-28 995
^1da177e4c3f4152 Linus Torvalds 2005-04-16 996 *nmp = *mp;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 997 nsbp = &nmp->m_sb;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 998 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 999 * Calculate new sb and mount fields for this round.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1000 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1001 nsbp->sb_rextsize = in->extsize;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1002 nsbp->sb_rbmblocks = bmbno + 1;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1003 nsbp->sb_rblocks =
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1004 XFS_RTMIN(nrblocks,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1005 nsbp->sb_rbmblocks * NBBY *
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1006 nsbp->sb_blocksize * nsbp->sb_rextsize);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1007 nsbp->sb_rextents = nsbp->sb_rblocks;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1008 do_div(nsbp->sb_rextents, nsbp->sb_rextsize);
79071eb0b2f142b9 David Chinner 2008-08-13 1009 ASSERT(nsbp->sb_rextents != 0);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1010 nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1011 nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1012 nrsumsize =
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1013 (uint)sizeof(xfs_suminfo_t) * nrsumlevels *
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1014 nsbp->sb_rbmblocks;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1015 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1016 nmp->m_rsumsize = nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1017 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1018 * Start a transaction, get the log reservation.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1019 */
253f4911f297b837 Christoph Hellwig 2016-04-06 1020 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtfree, 0, 0, 0,
253f4911f297b837 Christoph Hellwig 2016-04-06 1021 &tp);
3d3c8b5222b92447 Jie Liu 2013-08-12 1022 if (error)
253f4911f297b837 Christoph Hellwig 2016-04-06 1023 break;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1024 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1025 * Lock out other callers by grabbing the bitmap inode lock.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1026 */
1050c71e2925ab0c Christoph Hellwig 2011-02-13 1027 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
ddc3415aba1cb2f8 Christoph Hellwig 2011-09-19 1028 xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1029 /*
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1030 * Update the bitmap inode's size ondisk and incore. We need
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1031 * to update the incore size so that inode inactivation won't
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1032 * punch what it thinks are "posteof" blocks.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1033 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1034 mp->m_rbmip->i_d.di_size =
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1035 nsbp->sb_rbmblocks * nsbp->sb_blocksize;
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1036 i_size_write(VFS_I(mp->m_rbmip), mp->m_rbmip->i_d.di_size);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1037 xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1038 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1039 * Get the summary inode into the transaction.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1040 */
1050c71e2925ab0c Christoph Hellwig 2011-02-13 1041 xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL);
ddc3415aba1cb2f8 Christoph Hellwig 2011-09-19 1042 xfs_trans_ijoin(tp, mp->m_rsumip, XFS_ILOCK_EXCL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1043 /*
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1044 * Update the summary inode's size. We need to update the
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1045 * incore size so that inode inactivation won't punch what it
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1046 * thinks are "posteof" blocks.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1047 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1048 mp->m_rsumip->i_d.di_size = nmp->m_rsumsize;
f4c32e87de7d6607 Darrick J. Wong 2020-10-07 1049 i_size_write(VFS_I(mp->m_rsumip), mp->m_rsumip->i_d.di_size);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1050 xfs_trans_log_inode(tp, mp->m_rsumip, XFS_ILOG_CORE);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1051 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1052 * Copy summary data from old to new sizes.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1053 * Do this when the real size (not block-aligned) changes.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1054 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1055 if (sbp->sb_rbmblocks != nsbp->sb_rbmblocks ||
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1056 mp->m_rsumlevels != nmp->m_rsumlevels) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1057 error = xfs_rtcopy_summary(mp, nmp, tp);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1058 if (error)
0924b585fc49bf37 Dave Chinner 2008-11-28 1059 goto error_cancel;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1060 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1061 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1062 * Update superblock fields.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1063 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1064 if (nsbp->sb_rextsize != sbp->sb_rextsize)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1065 xfs_trans_mod_sb(tp, XFS_TRANS_SB_REXTSIZE,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1066 nsbp->sb_rextsize - sbp->sb_rextsize);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1067 if (nsbp->sb_rbmblocks != sbp->sb_rbmblocks)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1068 xfs_trans_mod_sb(tp, XFS_TRANS_SB_RBMBLOCKS,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1069 nsbp->sb_rbmblocks - sbp->sb_rbmblocks);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1070 if (nsbp->sb_rblocks != sbp->sb_rblocks)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1071 xfs_trans_mod_sb(tp, XFS_TRANS_SB_RBLOCKS,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1072 nsbp->sb_rblocks - sbp->sb_rblocks);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1073 if (nsbp->sb_rextents != sbp->sb_rextents)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1074 xfs_trans_mod_sb(tp, XFS_TRANS_SB_REXTENTS,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1075 nsbp->sb_rextents - sbp->sb_rextents);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1076 if (nsbp->sb_rextslog != sbp->sb_rextslog)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1077 xfs_trans_mod_sb(tp, XFS_TRANS_SB_REXTSLOG,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1078 nsbp->sb_rextslog - sbp->sb_rextslog);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1079 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1080 * Free new extent.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1081 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1082 bp = NULL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1083 error = xfs_rtfree_range(nmp, tp, sbp->sb_rextents,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1084 nsbp->sb_rextents - sbp->sb_rextents, &bp, &sumbno);
0924b585fc49bf37 Dave Chinner 2008-11-28 1085 if (error) {
0924b585fc49bf37 Dave Chinner 2008-11-28 1086 error_cancel:
4906e21545814e41 Christoph Hellwig 2015-06-04 1087 xfs_trans_cancel(tp);
d432c80e68e3c283 Nathan Scott 2006-09-28 1088 break;
0924b585fc49bf37 Dave Chinner 2008-11-28 1089 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1090 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1091 * Mark more blocks free in the superblock.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1092 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1093 xfs_trans_mod_sb(tp, XFS_TRANS_SB_FREXTENTS,
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1094 nsbp->sb_rextents - sbp->sb_rextents);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1095 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1096 * Update mp values into the real mp structure.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1097 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1098 mp->m_rsumlevels = nrsumlevels;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1099 mp->m_rsumsize = nrsumsize;
e5720eec0548c089 David Chinner 2008-04-10 1100
70393313dd0b26a6 Christoph Hellwig 2015-06-04 1101 error = xfs_trans_commit(tp);
0924b585fc49bf37 Dave Chinner 2008-11-28 1102 if (error)
e5720eec0548c089 David Chinner 2008-04-10 1103 break;
e5720eec0548c089 David Chinner 2008-04-10 1104 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1105
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1106 /*
d432c80e68e3c283 Nathan Scott 2006-09-28 1107 * Free the fake mp structure.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1108 */
f0e2d93c29dc39ff Denys Vlasenko 2008-05-19 1109 kmem_free(nmp);
d432c80e68e3c283 Nathan Scott 2006-09-28 1110
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1111 /*
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1112 * If we had to allocate a new rsum_cache, we either need to free the
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1113 * old one (if we succeeded) or free the new one and restore the old one
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1114 * (if there was an error).
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1115 */
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1116 if (rsum_cache != mp->m_rsum_cache) {
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1117 if (error) {
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1118 kmem_free(mp->m_rsum_cache);
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1119 mp->m_rsum_cache = rsum_cache;
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1120 } else {
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1121 kmem_free(rsum_cache);
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1122 }
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1123 }
65eed012d1f2d0f0 Omar Sandoval 2018-12-21 1124
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1125 return error;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1126 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1127
:::::: The code at line 898 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (23457 bytes)
Powered by blists - more mailing lists