Skip to contentSkip to conversation

f2fs: do not assing a new segment for dio under space shortage

PATCH In review Jaegeuk Kim 2 participants 2 messages Aug 11, 2015 – Aug 12, 2015

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: do not assing a new segment for dio under space shortage

If there is not enough free segment, we should not assign a new segment explicitly. Otherwise, we can run out of free segment.

---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index 7d53cb4..bf1605d 100644
@@ -1225,7 +1225,8 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
 	mutex_lock(&sit_i->sentry_lock);
 
 	/* direct_io'ed data is aligned to the segment for better performance */
-	if (direct_io && curseg->next_blkoff)
+	if (direct_io && curseg->next_blkoff &&
+				!has_not_enough_free_secs(sbi, 0))
 		__allocate_new_segments(sbi, type);
 
 	*new_blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
Signature · 1 line
2.1.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Wednesday, August 12, 2015 2:34 AM
To: [email protected]; [email protected]; [email protected]
Cc: Jaegeuk Kim
Subject: [f2fs-dev] [PATCH] f2fs: do not assing a new segment for dio under space shortage

Quoted 4 lines

If there is not enough free segment, we should not assign a new segment explicitly. Otherwise, we can run out of free segment.

------------------------------------------------------------------------------