return ret;  /* Lock only if we have reason to believe wbuf contains relevant data, so that checking an erased block during wbuf recovery space allocation does not deadlock. */ down_read(&c->wbuf_sem); 
goto exit; 
int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf){	loff_t	orbf = 0, owbf = 0, lwbf = 0;	int	ret;	if (!jffs2_is_writebuffered(c))		return c->mtd->read(c->mtd, ofs, len, retlen, buf);	/* Read flash */	if (jffs2_cleanmarker_oob(c))		ret = c->mtd->read_ecc(c->mtd, ofs, len, retlen, buf, NULL, c->oobinfo);	else		ret = c->mtd->read(c->mtd, ofs, len, retlen, buf);	if ( (ret == -EBADMSG) && (*retlen == len) ) {		printk(KERN_WARNING "mtd->read(0x%zx bytes from 0x%llx) returned ECC error\n",		       len, ofs);		/* 		 * We have the raw data without ECC correction in the buffer, maybe 		 * we are lucky and all data or parts are correct. We check the node.		 * If data are corrupted node check will sort it out.		 * We keep this block, it will fail on write or erase and the we		 * mark it bad. Or should we do that now? But we should give him a chance.		 * Maybe we had a system crash or power loss before the ecc write or  		 * a erase was completed.		 * So we return success. :)		 */	 	ret = 0;	}		/* if no writebuffer available or write buffer empty, return */	if (!c->wbuf_pagesize || !c->wbuf_len)		return ret;;	/* if we read in a different block, return */	if (SECTOR_ADDR(ofs) != SECTOR_ADDR(c->wbuf_ofs))		return ret;	/* Lock only if we have reason to believe wbuf contains relevant data,	   so that checking an erased block during wbuf recovery space allocation	   does not deadlock. */	down_read(&c->wbuf_sem);	if (ofs >= c->wbuf_ofs) {		owbf = (ofs - c->wbuf_ofs);	/* offset in write buffer */		if (owbf > c->wbuf_len)		/* is read beyond write buffer ? */			goto exit;		lwbf = c->wbuf_len - owbf;	/* number of bytes to copy */		if (lwbf > len)				lwbf = len;	} else {			orbf = (c->wbuf_ofs - ofs);	/* offset in read buffer */		if (orbf > len)			/* is write beyond write buffer ? */			goto exit;		lwbf = len - orbf; 		/* number of bytes to copy */		if (lwbf > c->wbuf_len)				lwbf = c->wbuf_len;	}		if (lwbf > 0)		memcpy(buf+orbf,c->wbuf+owbf,lwbf);exit:	up_read(&c->wbuf_sem);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/894214d1a75745a283d5f1921125b3ad36d7ba26/wbuf.c/buggy/fs/jffs2/wbuf.c