diff options
-rw-r--r-- | fs/xfs/xfs_attr.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_fsops.c | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 3dd5c9c374cb..c7dab0c0bdda 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -2109,8 +2109,8 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) | |||
2109 | 2109 | ||
2110 | bp = xfs_buf_get(mp->m_ddev_targp, dblkno, blkcnt, | 2110 | bp = xfs_buf_get(mp->m_ddev_targp, dblkno, blkcnt, |
2111 | XBF_LOCK | XBF_DONT_BLOCK); | 2111 | XBF_LOCK | XBF_DONT_BLOCK); |
2112 | ASSERT(!xfs_buf_geterror(bp)); | 2112 | if (!bp) |
2113 | 2113 | return ENOMEM; | |
2114 | tmp = (valuelen < XFS_BUF_SIZE(bp)) ? valuelen : | 2114 | tmp = (valuelen < XFS_BUF_SIZE(bp)) ? valuelen : |
2115 | XFS_BUF_SIZE(bp); | 2115 | XFS_BUF_SIZE(bp); |
2116 | xfs_buf_iomove(bp, 0, tmp, src, XBRW_WRITE); | 2116 | xfs_buf_iomove(bp, 0, tmp, src, XBRW_WRITE); |
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index e023f940a3dd..1c6fdeb702ff 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -194,6 +194,10 @@ xfs_growfs_data_private( | |||
194 | bp = xfs_buf_get(mp->m_ddev_targp, | 194 | bp = xfs_buf_get(mp->m_ddev_targp, |
195 | XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), | 195 | XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), |
196 | XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); | 196 | XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); |
197 | if (!bp) { | ||
198 | error = ENOMEM; | ||
199 | goto error0; | ||
200 | } | ||
197 | agf = XFS_BUF_TO_AGF(bp); | 201 | agf = XFS_BUF_TO_AGF(bp); |
198 | memset(agf, 0, mp->m_sb.sb_sectsize); | 202 | memset(agf, 0, mp->m_sb.sb_sectsize); |
199 | agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); | 203 | agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); |
@@ -227,6 +231,10 @@ xfs_growfs_data_private( | |||
227 | bp = xfs_buf_get(mp->m_ddev_targp, | 231 | bp = xfs_buf_get(mp->m_ddev_targp, |
228 | XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), | 232 | XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), |
229 | XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); | 233 | XFS_FSS_TO_BB(mp, 1), XBF_LOCK | XBF_MAPPED); |
234 | if (!bp) { | ||
235 | error = ENOMEM; | ||
236 | goto error0; | ||
237 | } | ||
230 | agi = XFS_BUF_TO_AGI(bp); | 238 | agi = XFS_BUF_TO_AGI(bp); |
231 | memset(agi, 0, mp->m_sb.sb_sectsize); | 239 | memset(agi, 0, mp->m_sb.sb_sectsize); |
232 | agi->agi_magicnum = cpu_to_be32(XFS_AGI_MAGIC); | 240 | agi->agi_magicnum = cpu_to_be32(XFS_AGI_MAGIC); |
@@ -253,6 +261,10 @@ xfs_growfs_data_private( | |||
253 | XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), | 261 | XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), |
254 | BTOBB(mp->m_sb.sb_blocksize), | 262 | BTOBB(mp->m_sb.sb_blocksize), |
255 | XBF_LOCK | XBF_MAPPED); | 263 | XBF_LOCK | XBF_MAPPED); |
264 | if (!bp) { | ||
265 | error = ENOMEM; | ||
266 | goto error0; | ||
267 | } | ||
256 | block = XFS_BUF_TO_BLOCK(bp); | 268 | block = XFS_BUF_TO_BLOCK(bp); |
257 | memset(block, 0, mp->m_sb.sb_blocksize); | 269 | memset(block, 0, mp->m_sb.sb_blocksize); |
258 | block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); | 270 | block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); |
@@ -276,6 +288,10 @@ xfs_growfs_data_private( | |||
276 | XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), | 288 | XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), |
277 | BTOBB(mp->m_sb.sb_blocksize), | 289 | BTOBB(mp->m_sb.sb_blocksize), |
278 | XBF_LOCK | XBF_MAPPED); | 290 | XBF_LOCK | XBF_MAPPED); |
291 | if (!bp) { | ||
292 | error = ENOMEM; | ||
293 | goto error0; | ||
294 | } | ||
279 | block = XFS_BUF_TO_BLOCK(bp); | 295 | block = XFS_BUF_TO_BLOCK(bp); |
280 | memset(block, 0, mp->m_sb.sb_blocksize); | 296 | memset(block, 0, mp->m_sb.sb_blocksize); |
281 | block->bb_magic = cpu_to_be32(XFS_ABTC_MAGIC); | 297 | block->bb_magic = cpu_to_be32(XFS_ABTC_MAGIC); |
@@ -300,6 +316,10 @@ xfs_growfs_data_private( | |||
300 | XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), | 316 | XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), |
301 | BTOBB(mp->m_sb.sb_blocksize), | 317 | BTOBB(mp->m_sb.sb_blocksize), |
302 | XBF_LOCK | XBF_MAPPED); | 318 | XBF_LOCK | XBF_MAPPED); |
319 | if (!bp) { | ||
320 | error = ENOMEM; | ||
321 | goto error0; | ||
322 | } | ||
303 | block = XFS_BUF_TO_BLOCK(bp); | 323 | block = XFS_BUF_TO_BLOCK(bp); |
304 | memset(block, 0, mp->m_sb.sb_blocksize); | 324 | memset(block, 0, mp->m_sb.sb_blocksize); |
305 | block->bb_magic = cpu_to_be32(XFS_IBT_MAGIC); | 325 | block->bb_magic = cpu_to_be32(XFS_IBT_MAGIC); |