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
| ||
|
Message-ID: <20220831105125.mv2674t37yhns2sf@quack3> Date: Wed, 31 Aug 2022 12:51:25 +0200 From: Jan Kara <jack@...e.cz> To: Zhang Yi <yi.zhang@...wei.com> Cc: linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, cluster-devel@...hat.com, ntfs3@...ts.linux.dev, ocfs2-devel@....oracle.com, reiserfs-devel@...r.kernel.org, jack@...e.cz, tytso@....edu, akpm@...ux-foundation.org, axboe@...nel.dk, viro@...iv.linux.org.uk, rpeterso@...hat.com, agruenba@...hat.com, almaz.alexandrovich@...agon-software.com, mark@...heh.com, dushistov@...l.ru, hch@...radead.org, chengzhihao1@...wei.com, yukuai3@...wei.com Subject: Re: [PATCH 03/14] fs/buffer: replace ll_rw_block() On Wed 31-08-22 15:21:00, Zhang Yi wrote: > ll_rw_block() is not safe for the sync IO path because it skip buffers > which has been locked by others, it could lead to false positive EIO > when submitting read IO. So stop using ll_rw_block(), switch to use new > helpers which could guarantee buffer locked and submit IO if needed. > > Signed-off-by: Zhang Yi <yi.zhang@...wei.com> > --- > fs/buffer.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/fs/buffer.c b/fs/buffer.c > index a663191903ed..e14adc638bfe 100644 > --- a/fs/buffer.c > +++ b/fs/buffer.c ... > @@ -1342,7 +1342,8 @@ void __breadahead(struct block_device *bdev, sector_t block, unsigned size) > { > struct buffer_head *bh = __getblk(bdev, block, size); > if (likely(bh)) { > - ll_rw_block(REQ_OP_READ | REQ_RAHEAD, 1, &bh); > + if (trylock_buffer(bh)) > + __bh_read(bh, REQ_RAHEAD, false); I suppose this can be bh_readahead()? > brelse(bh); > } > } Otherwise the patch looks good. Honza -- Jan Kara <jack@...e.com> SUSE Labs, CR
Powered by blists - more mailing lists