lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 19 Mar 2013 16:04:18 +0900
From:	Jaegeuk Kim <jaegeuk.kim@...sung.com>
To:	Namjae Jeon <linkinjeon@...il.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net,
	Changman Lee <cm224.lee@...sung.com>
Subject: Re: [PATCH] f2fs: reduce unncessary locking pages during read

2013-03-19 (화), 13:54 +0900, Namjae Jeon:
> >
> > -	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > -	if (err) {
> > -		f2fs_put_page(page, 1);
> > -		return ERR_PTR(err);
> > +	if (PageUptodate(page)) {
> > +		unlock_page(page);
> > +		return page;
> >  	}
> > -	unlock_page(page);
> Hi Jaegeuk.
> > +
> > +	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > +	wait_on_page_locked(page);
> > +	if (!PageUptodate(page))
> > +		return ERR_PTR(-EIO);
> We don't need to release page before returning EIO ?

Good catch! :)

> 
> >  	return page;
> >  }
> >
> > @@ -241,9 +244,13 @@ struct page *get_lock_data_page(struct inode *inode,
> > pgoff_t index)
> >  	BUG_ON(dn.data_blkaddr == NULL_ADDR);
> >
> >  	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > -	if (err) {
> > -		f2fs_put_page(page, 1);
> > +	if (err)
> >  		return ERR_PTR(err);
> Here is also same. We don't need to release page in case of err ?

It's different.
The f2fs_readpage() releases the page if error is occurred.
Thanks,

> 
> Thanks.
> > +
> > +	lock_page(page);
> > +	if (!PageUptodate(page)) {
> > +		f2fs_put_page(page, 1);
> > +		return ERR_PTR(-EIO);
> >  	}
> >  	return page;
> >  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Jaegeuk Kim
Samsung

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ