From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/2] f2fs: fix wrong AUTO_RECOVER condition
Date: Fri, 25 Nov 2016 23:40:58 +0800 [thread overview]
Message-ID: <d5ae9fc5-d1be-8eb6-ed24-210fdcba73a2@kernel.org> (raw)
In-Reply-To: <20161117232958.10931-2-jaegeuk@kernel.org>
Hi Jaegeuk,
isize AUTO_RECOVER still be corrupted..., try below case:
1. xfs_io -f /mnt/f2fs/file -c "pwrite 0 4096" -c "fsync"
2. xfs_io -f /mnt/f2fs/file -c "falloc -k 4096 4096" -c "fsync"
3. md5sum /mnt/f2fs/file;
4. godown /mnt/f2fs/
5. umount /mnt/f2fs/
6. mount -t f2fs /dev/sdx /mnt/f2fs
7. md5sum /mnt/f2fs/file
It's hard to deside to recover isize or not when current recovered block is
fallocated, as we can allocate block inside or outside of isize.
Any thoughts?
Thanks,
On 2016/11/18 7:29, Jaegeuk Kim wrote:
> If i_size is not aligned to the f2fs's block size, we should not skip inode
> update during fsync.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/f2fs.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index f7b986c..68f4887 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -1741,7 +1741,8 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
> spin_unlock(&sbi->inode_lock[DIRTY_META]);
> return ret;
> }
> - if (!is_inode_flag_set(inode, FI_AUTO_RECOVER))
> + if (!is_inode_flag_set(inode, FI_AUTO_RECOVER) ||
> + i_size_read(inode) & PAGE_MASK)
> return false;
> return F2FS_I(inode)->last_disk_size == i_size_read(inode);
> }
>
------------------------------------------------------------------------------
next prev parent reply other threads:[~2016-11-25 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 23:29 [PATCH 1/2] f2fs: do not recover i_size if it's valid Jaegeuk Kim
2016-11-17 23:29 ` [PATCH 2/2] f2fs: fix wrong AUTO_RECOVER condition Jaegeuk Kim
2016-11-25 15:40 ` Chao Yu [this message]
2016-11-29 0:31 ` Jaegeuk Kim
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=d5ae9fc5-d1be-8eb6-ed24-210fdcba73a2@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--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).