For migration of encrypted inode's block, we load data of encrypted block
into meta inode's page cache, after checkpoint, those all intermediate
pages should be clean, and no one will read them again, so let's just
release them for more memory.
Signed-off-by: Chao Yu
---
fs/f2
We need to drop PG_checked flag on page as well when we clear PG_uptodate
flag, in order to avoid treating the page as GCing one later.
Signed-off-by: Weichao Guo
Signed-off-by: Chao Yu
---
fs/f2fs/data.c| 8 +++-
fs/f2fs/dir.c | 1 +
fs/f2fs/segment.c | 4 +++-
3 files changed, 11
- set_cold_data
- f2fs_truncate
- f2fs_setattr isize to 4k
- read 4k <--- hit data in cached page #0
Above race condition can cause read out invalid data in a truncated
page, fix it by i_gc_rwsem[WRITE] lock.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c |
On 2018/7/25 11:22, Jaegeuk Kim wrote:
> The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of
> fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop.
It seems there are other paths having the same issue, how about fixing all of
them in this patch?
Thanks,
>
On 2018/7/24 23:19, Yunlong Song wrote:
>
>
> On 2018/7/24 22:17, Chao Yu wrote:
>> On 2018/7/24 21:39, Yunlong Song wrote:
>>>
>>> On 2018/7/24 21:11, Chao Yu wrote:
>>>> On 2018/7/23 22:10, Yunlong Song wrote:
>>>>> If f2fs abo
From: Chao Yu
Like quota_ino feature, we need to reject mounting RDWR with image
which enables project_quota feature when there is no CONFIG_QUOTA
be set in kernel.
Signed-off-by: Chao Yu
---
fs/f2fs/super.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs
On 2018/7/24 17:34, Arnd Bergmann wrote:
> On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu
> causes a warning:
>
> fs/f2fs/inode.c: In function 'sanity_check_inode':
> fs/f2fs/inode.c:247:4: error: format '%lu' expects argument of type 'long
> unsigned int', but argument
uk:
"Practically, I don't see db corruption becase of this. We can excuse to lose
the last transaction."
Finally, we decide to keep original implementation of atomic write interface
sematics that we don't wait all dnode writeback before preflush+fua submission.
Signed-off-by: C
IO of dnode page can be
elimitnated, making fsyncer only need to wait for sync IO.
Signed-off-by: Chao Yu
---
v4:
- rebase to last dev-test.
fs/f2fs/node.c| 8 +++-
fs/f2fs/node.h| 5 +
fs/f2fs/segment.c | 4 +++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/fs
On 2018/7/24 21:39, Yunlong Song wrote:
>
>
> On 2018/7/24 21:11, Chao Yu wrote:
>> On 2018/7/23 22:10, Yunlong Song wrote:
>>> If f2fs aborts BG_GC, then the section bit of victim_secmap will be set,
>>> which will cause the section skipped in the future get_vic
On 2018/7/23 22:10, Yunlong Song wrote:
> If f2fs aborts BG_GC, then the section bit of victim_secmap will be set,
> which will cause the section skipped in the future get_victim of BG_GC.
> In a worst case that each section in the victim_secmap is set and there
> are enough free sections (so FG_GC
On 2018/7/16 18:03, Yunlong Song wrote:
> For the case when sbi->segs_per_sec > 1 with lfs mode, take
> section:segment = 5 for example, if the section prefree_map is
> ...previous section | current section (1 1 0 1 1) | next section...,
> then the start = x, end = x + 1, after start = start_segno
On 2018/7/12 23:09, Yunlong Song wrote:
> In lfs mode, it is better to submit and wait for discard of the
> new_blkaddr's overall section, rather than punch it which makes
> more small discards and is not friendly with flash alignment. And
> f2fs does not have to wait discard of each new_blkaddr ex
On 2018/7/7 5:09, Jaegeuk Kim wrote:
> This fixes to support unaligned dio as buffered writes.
Should we return -EINVAL as manual of write said:
EINVAL fd is attached to an object which is unsuitable for writing; or the file
was opened with the O_DIRECT flag, and either the address
specified
f2fs is focused on flash based storage, so let's enable real-time
discard by default, if user don't want to enable it, 'nodiscard'
mount option should be used on mount.
Signed-off-by: Chao Yu
---
fs/f2fs/super.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
broken by out-of-order
IO submission due to IO scheduler or driver.
Signed-off-by: Chao Yu
---
v2: add missing definition modification in f2fs.h.
fs/f2fs/f2fs.h | 2 +-
fs/f2fs/file.c | 17 -
fs/f2fs/node.c | 4 ++--
3 files changed, 7 insertions(+), 16 deletions(-)
diff --git
On 2018/7/2 10:16, Guenter Roeck wrote:
> On 07/01/2018 06:53 PM, Chao Yu wrote:
>> On 2018/7/2 4:57, Guenter Roeck wrote:
>>> gcc 8.1.0 complains:
>>>
>>> fs/f2fs/namei.c: In function 'f2fs_update_extension_list':
>>> fs/f2fs/namei.c:25
From: Chao Yu
If FI_EXTRA_ATTR is set in inode by fuzzing, inode.i_addr[0] will be
parsed as inode.i_extra_isize, then in __recover_inline_status, inline
data address will beyond boundary of page, result in accessing invalid
memory.
So in this condition, during reading inode page, let'
do not choose to kill it directly, instead, adding
an flag to disable the check now, if there is related code change,
we can reuse it to detect bugs.
Signed-off-by: Yunlei He
Signed-off-by: Chao Yu
---
v2: use unlikely suggested by Jaegeuk.
fs/f2fs/f2fs.h| 1 +
fs/f2fs/segment.c | 10
readdir_ra is sysfs configuration instead of mount option, so it should
not be initialized in default_options(), otherwise after remount, it can
be reset to be enabled which may not as user wish, so let's move it to
f2fs_tuning_parameters().
Signed-off-by: Chao Yu
---
fs/f2fs/super.c | 3 +
In fill_super, if root inode's attribute is incorrect, we need to
call f2fs_destroy_stats to release stats memory.
Signed-off-by: Chao Yu
---
fs/f2fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 19ef966a99e9..a790dae
From: Chao Yu
If we change system time to the past, get_mtime() will return a
overflowed time, and SIT_I(sbi)->max_mtime will be udpated
incorrectly, this patch fixes the two issues.
Signed-off-by: Chao Yu
---
v2:
- fix to correct return value of get_mtime().
fs/f2fs/checkpoint.c | 2 +-
From: Chao Yu
Configure io_bits with 2 and enable LFS mode, generic/013 reports below dmesg:
BUG: unable to handle kernel NULL pointer dereference at 0104
*pdpt = 29b7b001 *pde =
Oops: 0002 [#1] PREEMPT SMP
Modules linked in: crc32_generic zram f2fs(O) rfcomm bnep
From: Chao Yu
Configure io_bits with 2 and enable LFS mode, generic/017 reports below dmesg:
BUG: unable to handle kernel NULL pointer dereference at 0039
*pdpt = 2fcb2001 *pde =
Oops: [#1] PREEMPT SMP
Modules linked in: crc32_generic zram f2fs(O) bnep rfcomm
This patch fixes error path of move_data_page:
- clear cold data flag if it fails to write page.
- redirty page for non-ENOMEM case.
Signed-off-by: Chao Yu
---
fs/f2fs/gc.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index
As description in commit "f2fs: don't drop any page on f2fs_cp_error()
case":
"We still provide readdir() after shtudown, so we should keep pages to
avoid additional IOs."
In order to provider lastest directory structure, let's keep dentry
pages in cache after fs
thread mount option, the memory can be released if we turn off
that mount option, but still there are several places access gc_thread
pointer without considering race condition, result in NULL point
dereference.
In order to fix this issue, use sb->s_umount to exclude those operations.
Signed-
On 2018/5/25 11:46, Ming Lei wrote:
> bio_for_each_page_all() can't be used any more after multipage bvec is
> enabled, so we have to convert to bio_for_each_page_all2().
>
> Signed-off-by: Ming Lei
Acked-by: Chao Yu
Thanks,
On 2018/5/26 16:09, Yunlong Song wrote:
> zone_align_start_offset should be u64, but config.start_sector is u32,
> so it may be overflow when computing zone_align_start_offset.
Could you rebase this patch on top of "f2fs-tools: fix to match with the
start_sector"?
Thanks,
>
> Signed-off-by: Yun
ce start_sector is got from ioctl HDIO_GETGEO and
> is always in 512 size unit for a sector. To fix this problem, just
> change the sector_size to the default value when computing with
> start_sector. And fix sectors_per_blk as well.
>
> Signed-off-by: Yunlong Song
Reviewed-by: Chao Yu
Thanks,
Introduce clear_radix_tree_dirty_tag to include common codes for cleanup.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c | 11 +++
fs/f2fs/dir.c| 8 +---
fs/f2fs/f2fs.h | 1 +
fs/f2fs/inline.c | 7 +--
fs/f2fs/node.c | 12 ++--
5 files changed, 16 insertions
order to avoid entering
above writeback flow, let's detect recovery status and do skip in
f2fs_balance_fs_bg.
Signed-off-by: Chao Yu
Signed-off-by: Yunlei He
---
fs/f2fs/segment.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 7dc59ae
On 2018/5/26 3:49, Jaegeuk Kim wrote:
> The fstrim gathers huge number of large discard commands, and tries to issue
> without IO awareness, which results in long user-perceive IO latencies on
> READ, WRITE, and FLUSH in UFS. We've observed some of commands take several
> seconds due to long discar
On 2018/5/26 9:04, Jaegeuk Kim wrote:
> For non-atomic files, this patch adds an option to give nobarrier which
> doesn't issue flush commands to the device.
>
> Signed-off-by: Jaegeuk Kim
Reviewed-by: Chao Yu
Thanks,
dd an additional lock to keep submitting
order.
Signed-off-by: Chao Yu
Signed-off-by: Yunlong Song
---
v2:
- introduce variable lfs_mode to record historical option, it can avoid
option being changed.
fs/f2fs/f2fs.h| 2 ++
fs/f2fs/gc.c | 6 ++
fs/f2fs/segment.c | 5 +
fs/f2fs/super.c
conds due to long discard latency.
>
> This patch limits the maximum size to 2MB per candidate, and check IO
> congestion
> when issuing them to disk.
>
> Signed-off-by: Jaegeuk Kim
It looks good to me. :)
Reviewed-by: Chao Yu
Thanks,
f2fs_ioctl+0xc0c/0x1ce0
> f2fs_compat_ioctl+0x98/0x1f0
>
> Signed-off-by: Sahitya Tummala
Reviewed-by: Chao Yu
Thanks,
On 2018/5/25 14:18, Jaegeuk Kim wrote:
> On 05/25, Chao Yu wrote:
>> Hi Jaegeuk,
>>
>> On 2018/5/25 13:10, Jaegeuk Kim wrote:
>>> The fstrim gathers huge number of large discard commands, and tries to issue
>>> without IO awareness, which results in long
Hi Jaegeuk,
On 2018/5/25 13:10, Jaegeuk Kim wrote:
> The fstrim gathers huge number of large discard commands, and tries to issue
> without IO awareness, which results in long user-perceive IO latencies on
> READ, WRITE, and FLUSH in UFS. We've observed some of commands take several
> seconds due
dd an additional lock to keep submitting
order.
Signed-off-by: Chao Yu
Signed-off-by: Yunlong Song
---
fs/f2fs/f2fs.h| 2 ++
fs/f2fs/gc.c | 5 +
fs/f2fs/segment.c | 5 +
fs/f2fs/super.c | 1 +
4 files changed, 13 insertions(+)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
From: Chao Yu
This patch changes to detect synchronous writeback more earlier before,
in order to avoid unnecessary page writeback before exiting asynchronous
writeback.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a
From: Chao Yu
- rename is_valid_blkaddr() to is_valid_meta_blkaddr() for readability.
- introduce is_valid_blkaddr() for cleanup.
No logic change in this patch.
Signed-off-by: Chao Yu
---
fs/f2fs/checkpoint.c | 4 ++--
fs/f2fs/data.c | 18 +-
fs/f2fs/f2fs.h | 9
On 2018/5/8 5:36, Jaegeuk Kim wrote:
> On 05/07, Chao Yu wrote:
>> Thread A Thread BThread C
>> - f2fs_remount
>> - stop_gc_thread
>> - f2fs_sbi_store
>>
Hi Jaegeuk,
Could you recheck this patch?
On 2018/4/23 10:36, Chao Yu wrote:
> After revoking atomic write, related LBA can be reused by others, so we
> need to wait page writeback before reusing the LBA, in order to avoid
> interference between old atomic written in-flight IO a
On 2018/5/17 16:03, Sahitya Tummala wrote:
> f2fs_ioc_shutdown() ioctl gets stuck in the below path
> when issued with F2FS_GOING_DOWN_FULLSYNC option.
>
> __switch_to+0x90/0xc4
> percpu_down_write+0x8c/0xc0
> freeze_super+0xec/0x1e4
> freeze_bdev+0xc4/0xcc
> f2fs_ioctl+0xc0c/0x1ce0
> f2fs_compat_
On 2018/5/15 15:57, Sahitya Tummala wrote:
> On Mon, May 14, 2018 at 11:39:42AM +0800, Chao Yu wrote:
>> On 2018/5/10 21:20, Sahitya Tummala wrote:
>>> f2fs_ioc_shutdown() ioctl gets stuck in the below path
>>> when going down with full sync (F2FS_GOIN
Sorry, I sent the wrong patch, please ignore this one.
On 2018/5/15 18:50, Chao Yu wrote:
> i_current_depth is used only for directory inode, but its space is
> shared with i_gc_failures field used for regular inode, in order to
> avoid affecting i_gc_failures' value, this
Since sit_i.min_mtime's type is unsigned long long, so we should
initialize it with max value of the type ULLONG_MAX instead of
LLONG_MAX.
Signed-off-by: Chao Yu
---
fs/f2fs/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
i_current_depth is used only for directory inode, but its space is
shared with i_gc_failures field used for regular inode, in order to
avoid affecting i_gc_failures' value, this patch fixes to initialize
the union's fields according to inode type.
Signed-off-by: Chao Yu
---
v2:
- r
On 2018/5/10 21:20, Sahitya Tummala wrote:
> f2fs_ioc_shutdown() ioctl gets stuck in the below path
> when going down with full sync (F2FS_GOING_DOWN_FULLSYNC)
> option.
>
> __switch_to+0x90/0xc4
> percpu_down_write+0x8c/0xc0
> freeze_super+0xec/0x1e4
> freeze_bdev+0xc4/0xcc
> f2fs_ioctl+0xc0c/0x1
On 2018/5/9 2:03, Mark Fasheh wrote:
> Signed-off-by: Mark Fasheh
Reviewed-by: Chao Yu
Thanks,
patch fixes to treat atomic page as checkpoint guaranteed one,
then in checkpoint, we can make sure all atomic page can be writebacked
with metadata of atomic file.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
On 2018/5/8 11:31, Jaegeuk Kim wrote:
> On 05/08, Chao Yu wrote:
>> On 2018/5/8 4:46, Jaegeuk Kim wrote:
>>> On 04/27, Chao Yu wrote:
>>>> On 2018/4/27 0:36, Jaegeuk Kim wrote:
>>>>> On 04/26, Chao Yu wrote:
>>>>>> On 2018
thread mount option, the memory can be released if we turn off
that mount option, but still there are several places access gc_thread
pointer without considering race condition, result in NULL point
dereference.
In order to fix this issue, use sb->s_umount to exclude those operations.
Signed-
thread mount option, the memory can be released if we turn off
that mount option, but still there are several places access gc_thread
pointer without considering race condition, result in NULL point
dereference.
In order to fix this issue, use sb->s_umount to exclude those operations.
Signed-
On 2018/5/8 11:17, Jaegeuk Kim wrote:
> On 05/08, Chao Yu wrote:
>> On 2018/5/8 5:36, Jaegeuk Kim wrote:
>>> On 05/07, Chao Yu wrote:
>>>> Thread A Thread BThread C
>>>> - f2fs_remount
>>>> - stop_gc_t
On 2018/5/8 4:46, Jaegeuk Kim wrote:
> On 04/27, Chao Yu wrote:
>> On 2018/4/27 0:36, Jaegeuk Kim wrote:
>>> On 04/26, Chao Yu wrote:
>>>> On 2018/4/26 23:48, Jaegeuk Kim wrote:
>>>>> On 04/26, Chao Yu wrote:
>>>>>> Thread A
patch fixes to try to wait all atomic pages writeback in
block_operations().
Signed-off-by: Chao Yu
---
fs/f2fs/checkpoint.c | 4 +++-
fs/f2fs/data.c | 2 ++
fs/f2fs/f2fs.h | 2 ++
fs/f2fs/segment.c| 17 +
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git
On 2018/5/8 5:36, Jaegeuk Kim wrote:
> On 05/07, Chao Yu wrote:
>> Thread A Thread BThread C
>> - f2fs_remount
>> - stop_gc_thread
>> - f2fs_sbi_store
>>
ition, his patch adds to show GC skip information in debugfs,
now it just shows count of skipped caused by atomic write.
Signed-off-by: Chao Yu
---
v2:
- rebase code.
fs/f2fs/data.c| 2 +-
fs/f2fs/debug.c | 6 ++
fs/f2fs/f2fs.h| 21 +++--
fs/f2fs/file
Introduce GC_I to replace sbi->gc_thread for cleanup, no logic changes.
Signed-off-by: Chao Yu
---
v2:
- rebase code.
fs/f2fs/debug.c | 2 +-
fs/f2fs/f2fs.h| 5 +
fs/f2fs/gc.c | 14 +++---
fs/f2fs/segment.c | 4 ++--
fs/f2fs/super.c | 4 ++--
fs/f2fs/sysfs.c |
i_current_depth is used only for directory inode, but its space is
shared with i_gc_failures field used for regular inode, in order to
avoid affecting i_gc_failures' value, this patch fixes to initialize
the union's fields according to inode type.
Signed-off-by: Chao Yu
---
v2:
- r
are several places access gc_thread
pointer without considering race condition, result in NULL point
dereference.
In order to fix this issue, introduce gc_rwsem to exclude those operations.
Signed-off-by: Chao Yu
---
v4:
- use introduced sbi.gc_rwsem lock instead of sb.s_umount.
fs/f2fs/f2fs.h
On 2018/5/5 18:02, Chao Yu wrote:
> Thread A Thread BThread C
> - f2fs_remount
> - stop_gc_thread
> - f2fs_sbi_store
> - issue_discard_thread
>sbi
ition, his patch adds to show GC skip information in debugfs,
now it just shows count of skipped caused by atomic write.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c| 2 +-
fs/f2fs/debug.c | 8
fs/f2fs/f2fs.h| 19 +--
fs/f2fs/file.c| 20 ++--
fs
i_current_depth is used only for directory inode, but its space is
shared with i_gc_failures field used for regular inode, in order to
avoid affecting i_gc_failures' value, this patch fixes to initialize
the union's fields according to inode type.
Signed-off-by: Chao Yu
---
fs/f2fs/in
Introduce GC_I to replace sbi->gc_thread for cleanup, no logic changes.
Signed-off-by: Chao Yu
---
fs/f2fs/debug.c | 2 +-
fs/f2fs/f2fs.h| 5 +
fs/f2fs/gc.c | 14 +++---
fs/f2fs/segment.c | 4 ++--
fs/f2fs/super.c | 4 ++--
fs/f2fs/sysfs.c | 8
6 fi
are several places access gc_thread
pointer without considering race condition, result in NULL point
dereference.
In order to fix this issue, use sb->s_umount to exclude those operations
Signed-off-by: Chao Yu
---
v3:
- use sb->s_umount to make all race cases exclusive.
fs/f2fs/gc.c
Ping,
On 2018/4/27 10:55, Chao Yu wrote:
> Hi Jaegeuk,
>
> Missed this patch, or any problem in it?
>
> Thanks,
>
> On 2018/4/26 17:05, Chao Yu wrote:
>> For extreme case:
>> 10 section, op = 10%, no_fggc_threshold = 90%
>> All section usage:
Ping,
On 2018/4/27 10:37, Chao Yu wrote:
> On 2018/4/27 0:36, Jaegeuk Kim wrote:
>> On 04/26, Chao Yu wrote:
>>> On 2018/4/26 23:48, Jaegeuk Kim wrote:
>>>> On 04/26, Chao Yu wrote:
>>>>> Thread A Thread B
>>>>>
On 2018/5/5 2:59, Jaegeuk Kim wrote:
> On 05/02, Chao Yu wrote:
>> On 2018/4/28 10:36, Jaegeuk Kim wrote:
>>> On 04/27, Chao Yu wrote:
>>>> On 2018/4/27 0:03, Jaegeuk Kim wrote:
>>>>> On 04/24, Chao Yu wrote:
>>>>>> Thread A
On 2018/5/4 17:20, Yunlong Song wrote:
> f2fs-tools uses ioctl BLKSSZGET to get sector_size, however, this ioctl
> will return a value which may be larger than 512 (according to the value
> of q->limits.logical_block_size), then this will be inconsistent with
> the start_sector, since start_sector
On 2018/4/30 23:27, Colin King wrote:
> From: Colin Ian King
>
> Trivial fix to spelling mistake in extension list text
>
> Signed-off-by: Colin Ian King
Reviewed-by: Chao Yu
Thanks,
On 2018/4/28 10:36, Jaegeuk Kim wrote:
> On 04/27, Chao Yu wrote:
>> On 2018/4/27 0:03, Jaegeuk Kim wrote:
>>> On 04/24, Chao Yu wrote:
>>>> Thread A Thread BThread C
>>>> - f2fs_remount
>>>> - stop_gc_t
On 2018/4/28 10:34, Jaegeuk Kim wrote:
> On 04/27, Chao Yu wrote:
>> On 2018/4/26 23:54, Jaegeuk Kim wrote:
>>> On 04/24, Chao Yu wrote:
>>>> f2fs doesn't allow abuse on atomic write class interface, so except
>>>> limiting in-mem pages' total
Hi Jaegeuk,
Missed this patch, or any problem in it?
Thanks,
On 2018/4/26 17:05, Chao Yu wrote:
> For extreme case:
> 10 section, op = 10%, no_fggc_threshold = 90%
> All section usage: 85% 85% 85% 85% 90% 90% 95% 95% 95% 95%
>
> During foreground GC, if we skip select dirty sect
On 2018/4/27 0:36, Jaegeuk Kim wrote:
> On 04/26, Chao Yu wrote:
>> On 2018/4/26 23:48, Jaegeuk Kim wrote:
>>> On 04/26, Chao Yu wrote:
>>>> Thread A Thread B
>>>> - f2fs_ioc_commit_atomic_write
>>>> - com
On 2018/4/27 10:04, Chao Yu wrote:
> On 2018/4/27 0:03, Jaegeuk Kim wrote:
>> On 04/24, Chao Yu wrote:
>>> Thread AThread BThread C
>>> - f2fs_remount
>>> - stop_gc_thread
>>>
On 2018/4/27 0:03, Jaegeuk Kim wrote:
> On 04/24, Chao Yu wrote:
>> Thread A Thread BThread C
>> - f2fs_remount
>> - stop_gc_thread
>> - f2fs_sbi_store
>>
d-and-tested-by: syzbot+bf9253040425feb15...@syzkaller.appspotmail.com
> Reported-and-tested-by: syzbot+7d6d31d3bc702f566...@syzkaller.appspotmail.com
> Reported-and-tested-by: syzbot+0a725420475916460...@syzkaller.appspotmail.com
> Signed-off-by: Jaegeuk Kim
Reviewed-by: Chao Yu
Thanks,
On 2018/4/26 23:54, Jaegeuk Kim wrote:
> On 04/24, Chao Yu wrote:
>> f2fs doesn't allow abuse on atomic write class interface, so except
>> limiting in-mem pages' total memory usage capacity, we need to limit
>> atomic-write usage as well when filesystem is seriou
On 2018/4/26 23:32, Jaegeuk Kim wrote:
> On 04/25, Chao Yu wrote:
>> On 2018/4/25 13:46, Jaegeuk Kim wrote:
>>> This is to give a option for user to be able to recover B/foo in the below
>>> case.
>>>
>>> mkdir A
>>> sync()
>>>
On 2018/4/26 23:48, Jaegeuk Kim wrote:
> On 04/26, Chao Yu wrote:
>> Thread A Thread B
>> - f2fs_ioc_commit_atomic_write
>> - commit_inmem_pages
>> - f2fs_submit_merged_write_cond
>> : write data
>>
Volatile file's data will be updated oftenly, so it'd better to place
its data into hot data segment.
In addition, for atomic file, we change to check FI_ATOMIC_FILE instead
of FI_HOT_DATA to make code readability better.
Signed-off-by: Chao Yu
---
fs/f2fs/file.c| 2 --
fs/f2fs
: Chao Yu
---
fs/f2fs/f2fs.h| 3 ---
fs/f2fs/gc.c | 16
fs/f2fs/segment.h | 9 -
3 files changed, 28 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 64e3677998d8..9f8b327272df 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1192,9 +1192,6
it results in
atomic written data being corrupted.
This patch adds f2fs_wait_on_page_writeback in __revoke_inmem_pages() to
keep data and node of atomic file being flushed orderly.
Signed-off-by: Chao Yu
---
fs/f2fs/file.c| 4
fs/f2fs/segment.c | 3 +++
2 files changed, 7 inserti
y, let me merge these two patches.
Thanks,
On 2018/4/23 23:14, Chao Yu wrote:
> From: Chao Yu
>
> Thread A Thread B
> - f2fs_ioc_commit_atomic_write
> - commit_inmem_pages
> - f2fs_submit_m
On 2018/4/25 13:46, Jaegeuk Kim wrote:
> This is to give a option for user to be able to recover B/foo in the below
> case.
>
> mkdir A
> sync()
> rename(A, B)
> creat (B/foo)
> fsync (B/foo)
> ---crash---
That makes sense, IMO, it will be better to cover cross rename case as well?
Thanks,
>
>
Hi Jaegeuk,
This patch makes generic/008 failed, because for fallocate case, total valid
block count can not be calculated by gathering valid_blocks of all sit entries.
Thanks,
On 2018/4/25 13:46, Jaegeuk Kim wrote:
> This patch enhances sanity check for SIT entries.
>
> syzbot hit the followin
0a
> R10: R11: 0297 R12: 0004
> R13: 00402c60 R14: R15:
> RIP: build_sit_entries fs/f2fs/segment.c:3653 [inline] RSP: 8801b102e5b0
> RIP: build_segment_manager+0x7ef7/0xbf70 fs/f2fs/segment.c:3852 RSP
/f2fs/inode.c:238 [inline] RSP: 8801c44a70e8
> RIP: f2fs_iget+0x3307/0x3ca0 fs/f2fs/inode.c:313 RSP: 8801c44a70e8
> invalid opcode: [#2] SMP KASAN
> ---[ end trace 1cbcbec2156680bc ]---
>
> Reported-and-tested-by: syzbot+41a1b341571f0952b...@syzkaller.appspotmail.com
> Signed-off-by: Jaegeuk Kim
Reviewed-by: Chao Yu
Thanks,
On 2018/4/25 13:46, Jaegeuk Kim wrote:
> syzbot hit the following crash on upstream commit
> 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +)
> Merge branch 'fixes' of
> git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
> syzbot dashboard link:
> ht
From: Chao Yu
In build_sit_entries(), if valid_blocks in SIT block is smaller than
valid_blocks in journal, for below calculation:
sbi->discard_blks += old_valid_blocks - se->valid_blocks;
There will be two times potential overflow:
- old_valid_blocks - se->valid_blocks will overflow,
Split discard slab cache related initial/release codes into separated
function {create,destroy}_discard_caches, later we can maintain those
independent functions in separated discard.c
Signed-off-by: Chao Yu
---
fs/f2fs/f2fs.h| 2 ++
fs/f2fs/segment.c | 24
fs/f2fs
devi, sbi->s_ndevs ? FDEV(devi).path: "",
Signed-off-by: Chao Yu
---
fs/f2fs/Makefile |2 +-
fs/f2fs/discard.c | 1009 +
fs/f2fs/f2fs.h| 34 +-
fs/f2fs/segment.c | 991 +---
Introduce release_discard_addr() to include common codes for cleanup.
Signed-off-by: Chao Yu
---
fs/f2fs/segment.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9e0c6babacec..d5627195aa8e 100644
--- a/fs/f2fs
Hi Jaegeuk,
On 2018/4/24 6:49, Jaegeuk Kim wrote:
> This patch clear page_error bit, if the page is going to be writebacked.
This patch is similar to previous patch ("f2fs: clear PageError on writepage"),
only coverage is different, could you merge them?
Thanks,
>
> Signed-off-by: Jaegeuk Kim
RW semphore dio_rwsem in struct f2fs_inode_info is introduced to avoid
race between dio and data gc, but now, it is more wildly used to avoid
foreground operation vs data gc. So rename it to i_gc_rwsem to improve
its readability.
Signed-off-by: Chao Yu
---
fs/f2fs/data.c | 6 +++---
fs/f2fs
ition, his patch adds to show GC skip information in debugfs,
now it just shows count of skipped caused by atomic write.
Signed-off-by: Chao Yu
---
v2:
- add to show skip info in debugfs.
fs/f2fs/debug.c | 8
fs/f2fs/f2fs.h| 2 ++
fs/f2fs/file.c| 5 +
fs/f2fs/gc.c
gc_thread.
Signed-off-by: Chao Yu
---
v2:
- add a rw semaphore to exclude rw operation suggested by Jaegeuk.
fs/f2fs/debug.c | 3 +--
fs/f2fs/f2fs.h| 9 ++-
fs/f2fs/gc.c | 78 ---
fs/f2fs/gc.h | 1 +
fs/f2fs/segment.c | 1
901 - 1000 of 2304 matches
Mail list logo