* [PATCH 1/2] f2fs: check only data or node for summary
@ 2016-06-10 21:01 Jaegeuk Kim
2016-06-10 21:01 ` [PATCH 2/2] f2fs: report error for f2fs_parent_dir Jaegeuk Kim
2016-07-06 4:09 ` [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary He YunLei
0 siblings, 2 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2016-06-10 21:01 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim
We can check data or node types only for gc, since we allocate different type of
data/node blocks in a different logs occasionally.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/gc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e1d274c..c2c4ac3 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -806,7 +806,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
f2fs_put_page(sum_page, 0);
sum = page_address(sum_page);
- f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
+ f2fs_bug_on(sbi, IS_DATASEG(type) !=
+ IS_DATASEG(GET_SUM_TYPE((&sum->footer))));
/*
* this is to avoid deadlock:
--
2.8.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] f2fs: report error for f2fs_parent_dir
2016-06-10 21:01 [PATCH 1/2] f2fs: check only data or node for summary Jaegeuk Kim
@ 2016-06-10 21:01 ` Jaegeuk Kim
2016-07-06 4:09 ` [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary He YunLei
1 sibling, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2016-06-10 21:01 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim
If there is no dentry, we can report its error correctly.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/namei.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 78efe00..618829e 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -662,10 +662,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out;
if (S_ISDIR(old_inode->i_mode)) {
- err = -EIO;
old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page);
- if (!old_dir_entry)
+ if (!old_dir_entry) {
+ err = PTR_ERR(old_dir_page);
goto out_old;
+ }
}
if (flags & RENAME_WHITEOUT) {
@@ -838,19 +839,21 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
/* prepare for updating ".." directory entry info later */
if (old_dir != new_dir) {
if (S_ISDIR(old_inode->i_mode)) {
- err = -EIO;
old_dir_entry = f2fs_parent_dir(old_inode,
&old_dir_page);
- if (!old_dir_entry)
+ if (!old_dir_entry) {
+ err = PTR_ERR(old_dir_page);
goto out_new;
+ }
}
if (S_ISDIR(new_inode->i_mode)) {
- err = -EIO;
new_dir_entry = f2fs_parent_dir(new_inode,
&new_dir_page);
- if (!new_dir_entry)
+ if (!new_dir_entry) {
+ err = PTR_ERR(new_dir_page);
goto out_old_dir;
+ }
}
}
--
2.8.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary
2016-06-10 21:01 [PATCH 1/2] f2fs: check only data or node for summary Jaegeuk Kim
2016-06-10 21:01 ` [PATCH 2/2] f2fs: report error for f2fs_parent_dir Jaegeuk Kim
@ 2016-07-06 4:09 ` He YunLei
2016-07-06 17:50 ` Jaegeuk Kim
1 sibling, 1 reply; 4+ messages in thread
From: He YunLei @ 2016-07-06 4:09 UTC (permalink / raw)
To: Jaegeuk Kim, linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Bintian
On 2016/6/11 5:01, Jaegeuk Kim wrote:
> We can check data or node types only for gc, since we allocate different type of
> data/node blocks in a different logs occasionally.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/gc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index e1d274c..c2c4ac3 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -806,7 +806,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
> f2fs_put_page(sum_page, 0);
>
> sum = page_address(sum_page);
> - f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
> + f2fs_bug_on(sbi, IS_DATASEG(type) !=
> + IS_DATASEG(GET_SUM_TYPE((&sum->footer))));
Hi, Kim
type has been transformed into SUM_TYPE_DATA or SUM_TYPE_NODE, so here
no need to do this.
Thanks
>
> /*
> * this is to avoid deadlock:
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary
2016-07-06 4:09 ` [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary He YunLei
@ 2016-07-06 17:50 ` Jaegeuk Kim
0 siblings, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2016-07-06 17:50 UTC (permalink / raw)
To: He YunLei; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel, Bintian
On Wed, Jul 06, 2016 at 12:09:12PM +0800, He YunLei wrote:
> On 2016/6/11 5:01, Jaegeuk Kim wrote:
> > We can check data or node types only for gc, since we allocate different type of
> > data/node blocks in a different logs occasionally.
> >
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> > fs/f2fs/gc.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> > index e1d274c..c2c4ac3 100644
> > --- a/fs/f2fs/gc.c
> > +++ b/fs/f2fs/gc.c
> > @@ -806,7 +806,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
> > f2fs_put_page(sum_page, 0);
> >
> > sum = page_address(sum_page);
> > - f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
> > + f2fs_bug_on(sbi, IS_DATASEG(type) !=
> > + IS_DATASEG(GET_SUM_TYPE((&sum->footer))));
>
> Hi, Kim
> type has been transformed into SUM_TYPE_DATA or SUM_TYPE_NODE, so here
> no need to do this.
Oops, right. :)
Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-06 17:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 21:01 [PATCH 1/2] f2fs: check only data or node for summary Jaegeuk Kim
2016-06-10 21:01 ` [PATCH 2/2] f2fs: report error for f2fs_parent_dir Jaegeuk Kim
2016-07-06 4:09 ` [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary He YunLei
2016-07-06 17:50 ` Jaegeuk Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).