From 64564bd08f83a96484de3f519c9d733020f0daa7 Mon Sep 17 00:00:00 2001 From: pschwan Date: Wed, 28 May 2003 20:38:21 +0000 Subject: [PATCH] Extra debugging for a situation that may no longer be possible: if we enter ll_alloc_brw with an i_blksize of < PAGE_CACHE_SIZE, we would allocate enough space for zero pages. Then LASSERT soon thereafter. The fix that Andreas made to ll_file_open might prevent this, but just in case, if we ever get into here with llwp->max == 0, print an error and force it to be 1. --- lustre/llite/iod.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lustre/llite/iod.c b/lustre/llite/iod.c index ac5838f..5c11df1 100644 --- a/lustre/llite/iod.c +++ b/lustre/llite/iod.c @@ -160,9 +160,9 @@ static void ll_writeback(struct inode *inode, struct ll_writeback_pages *llwp) CERROR ("Can't create request set\n"); rc = -ENOMEM; } else { - rc = obd_brw_async (OBD_BRW_WRITE, ll_i2obdconn(inode), - ll_i2info(inode)->lli_smd, llwp->npgs, llwp->pga, - set, NULL); + rc = obd_brw_async(OBD_BRW_WRITE, ll_i2obdconn(inode), + ll_i2info(inode)->lli_smd, llwp->npgs, + llwp->pga, set, NULL); if (rc == 0) rc = ptlrpc_set_wait (set); ptlrpc_set_destroy (set); @@ -248,6 +248,11 @@ static int ll_alloc_brw(struct inode *inode, struct ll_writeback_pages *llwp) memset(llwp, 0, sizeof(struct ll_writeback_pages)); llwp->max = inode->i_blksize >> PAGE_CACHE_SHIFT; + if (llwp->max == 0) { + CERROR("forcing llwp->max to 1. blksize: %lu\n", + inode->i_blksize); + llwp->max = 1; + } llwp->pga = kmalloc(llwp->max * sizeof(*llwp->pga), GFP_ATOMIC); if (llwp->pga == NULL) RETURN(-ENOMEM); -- 1.8.3.1