linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: handle quota for orphan inodes
Date: Tue, 13 Feb 2018 22:33:26 +0800	[thread overview]
Message-ID: <e48fd2e5-fab6-57c5-5fff-2e44f5a817b0@kernel.org> (raw)
In-Reply-To: <20180210022841.5707-1-jaegeuk@kernel.org>

On 2018/2/10 10:28, Jaegeuk Kim wrote:
> This is to fix missing dquot_initialize for orphan inodes.

IMO, we don't need to call dquot_initialize as we have call the function
in evict(), right?

Thanks,

> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/checkpoint.c | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 8b0945ba284d..e3bf753a47be 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -569,13 +569,8 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
>  	struct node_info ni;
>  	int err = acquire_orphan_inode(sbi);
>  
> -	if (err) {
> -		set_sbi_flag(sbi, SBI_NEED_FSCK);
> -		f2fs_msg(sbi->sb, KERN_WARNING,
> -				"%s: orphan failed (ino=%x), run fsck to fix.",
> -				__func__, ino);
> -		return err;
> -	}
> +	if (err)
> +		goto err_out;
>  
>  	__add_ino_entry(sbi, ino, 0, ORPHAN_INO);
>  
> @@ -589,6 +584,11 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
>  		return PTR_ERR(inode);
>  	}
>  
> +	err = dquot_initialize(inode);
> +	if (err)
> +		goto err_out;
> +
> +	dquot_initialize(inode);
>  	clear_nlink(inode);
>  
>  	/* truncate all the data during iput */
> @@ -598,14 +598,18 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
>  
>  	/* ENOMEM was fully retried in f2fs_evict_inode. */
>  	if (ni.blk_addr != NULL_ADDR) {
> -		set_sbi_flag(sbi, SBI_NEED_FSCK);
> -		f2fs_msg(sbi->sb, KERN_WARNING,
> -			"%s: orphan failed (ino=%x) by kernel, retry mount.",
> -				__func__, ino);
> -		return -EIO;
> +		err = -EIO;
> +		goto err_out;
>  	}
>  	__remove_ino_entry(sbi, ino, ORPHAN_INO);
>  	return 0;
> +
> +err_out:
> +	set_sbi_flag(sbi, SBI_NEED_FSCK);
> +	f2fs_msg(sbi->sb, KERN_WARNING,
> +			"%s: orphan failed (ino=%x), run fsck to fix.",
> +			__func__, ino);
> +	return err;
>  }
>  
>  int recover_orphan_inodes(struct f2fs_sb_info *sbi)
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2018-02-13 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-10  2:28 [PATCH] f2fs: handle quota for orphan inodes Jaegeuk Kim
2018-02-13 14:33 ` Chao Yu [this message]
2018-02-27 10:46   ` [f2fs-dev] " Chao Yu
2018-02-28  5:23     ` Jaegeuk Kim
2018-02-28  9:37       ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e48fd2e5-fab6-57c5-5fff-2e44f5a817b0@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).