nilfs2: use GFP_NOIO for bio_alloc instead of GFP_NOWAIT
PATCH 1/1 nilfs2: use GFP_NOIO for bio_alloc instead of GFP_NOWAIT
This is a remaining todo item related to the write failure problem recently fixed. This patch would decrease the possibility of memory allocation failure during log-writing. I'll queue this for the next merge window.
Ryusuke Konishi
--
From: Ryusuke Konishi <[email protected]>
Alberto Bertogli advised me about bio_alloc() use in nilfs:
Quoted 5 lines · Alberto Bertogli
By the way, those bio_alloc()s are using
GFP_NOWAITbut it looks like they could use at leastGFP_NOIOorGFP_NOFS, since the caller can (and sometimes do) sleep. The only caller isnilfs_submit_bh(), which callsnilfs_submit_seg_bio()which can sleep callingwait_for_completion().
This takes in the comment and replaces the use of GFP_NOWAIT flag with GFP_NOIO.
--- fs/nilfs2/segbuf.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nilfs2/segbuf.c +2 -2
@@ -316,10 +316,10 @@ static struct bio *nilfs_alloc_seg_bio(struct super_block *sb, sector_t start, {struct bio *bio; - bio =bio_alloc (GFP_NOWAIT , nr_vecs); + bio =bio_alloc (GFP_NOIO , nr_vecs);if (bio ==NULL ) {while (!bio && (nr_vecs >>=1 )) - bio =bio_alloc (GFP_NOWAIT , nr_vecs); + bio =bio_alloc (GFP_NOIO , nr_vecs); }if (likely (bio)) { bio->bi_bdev = sb->s_bdev;
Signature · 1 line
1.6.3.4