All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-f2fs-devel@lists.sourceforge.net
Subject: [Bug 200871] F2FS experiences data loss (entry is completely lost) when an I/O failure occurs.
Date: Wed, 05 Sep 2018 21:40:50 +0000	[thread overview]
Message-ID: <bug-200871-202145-kpJwqgA3Pl@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-200871-202145@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=200871

--- Comment #7 from Stathis Maneas (smaneas@cs.toronto.edu) ---
Please find attached the required files to reproduce the error. Start with the
Makefile to compile and install the module into your kernel.

Assuming the underlying device is /dev/vdb, please execute the following
commands to initialize the file system:
$ dd if=/dev/zero of=/dev/vdb bs=4096
$ mkfs.f2fs -l F2FS /dev/vdb -d 10 -a 0 -O extra_attr -O inode_checksum
$ mount -t f2fs /dev/vdb /mnt/f2fs -o background_gc=off
$ cd /mnt/f2fs
$ dd if=/dev/urandom of=inline_file bs=3400 count=1
$ cd; umount /mnt/f2fs

In order to reproduce the error, we need two pieces of information:
- The device's number of sectors (invoking fdisk -l should be more than
sufficient to extract this information). In my case, this number is equal to
262,144.
- The block number (on disk) that will accommodate the newly updated inode
(after its mode has changed). In my case, this block number is equal to 4609.

Then, please execute the following commands to reproduce the error:
$ sudo dmsetup create f2fs_dev --table '0 262144 injector /dev/vdb 0 W4609'
--readahead none
$ dmesg -C; dmsetup message f2fs_dev 0 start
$ sudo mount -t f2fs /dev/mapper/f2fs_dev /mnt/f2fs -o background_gc=off
$ cd /mnt/f2fs/
$ /tmp/run_chmod inline_file
The operation "chmod" returned: 0 (errno: 0)

(Comment: During the execution of this command, the write operation that is
related to the newly updated inode (BlockID: 4609) is failed.)

$ cd; umount /mnt/f2fs

If everything is executed as expected, then dmesg should contain an entry
similar to the following:
Injecting (W) error for sec: 36872 and block: 4609

At this point, if we re-mount the file system, the file cannot be accessed
since its inode was never persisted on disk:
$ mount -t f2fs /dev/vdb /mnt/f2fs -o background_gc=off
$ cd /mnt/f2fs
$ ls -alR
.:
ls: cannot access inline_file: Invalid argument
total 8
drwxr-xr-x 2 root root 4096 Aug 20 17:04 .
drwxr-xr-x 3 root root 4096 Jun  5 14:50 ..
-????????? ? ?    ?       ?            ? inline_file
$ dmesg
...
[3247.026533] F2FS-fs (vdb): inconsistent node block, nid:4,
node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
...
$ cd; umount /mnt/f2fs

After invoking f2fs.fsck and answering 'yes' to all questions, we end up with a
consistent file system image, but now, the entry has disappeared:
$ mount -t f2fs /dev/vdb /mnt/f2fs -o background_gc=off
$ cd /mnt/f2fs
$ ls -alR
.:
total 8
drwxr-xr-x 2 root root 4096 Aug 20 17:04 .
drwxr-xr-x 3 root root 4096 Jun  5 14:50 ..
$ cd; umount /mnt/f2fs

Please let me know if you run into any issues while trying to reproduce the
error.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  parent reply	other threads:[~2018-09-05 21:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-200871-202145@https.bugzilla.kernel.org/>
2018-08-23 15:26 ` [Bug 200871] F2FS experiences data loss (entry is completely lost) when an I/O failure occurs bugzilla-daemon
2018-08-26  9:09 ` bugzilla-daemon
2018-08-26 23:43 ` bugzilla-daemon
2018-08-31  7:19 ` bugzilla-daemon
2018-09-05 21:22 ` bugzilla-daemon
2018-09-05 21:23 ` bugzilla-daemon
2018-09-05 21:23 ` bugzilla-daemon
2018-09-05 21:40 ` bugzilla-daemon [this message]
2018-09-05 21:42 ` bugzilla-daemon
2018-09-21  1:50   ` Sotirios-Efstathios Maneas
2018-09-21  2:18 ` bugzilla-daemon
2018-09-21  8:50 ` bugzilla-daemon
2018-09-23  4:16 ` bugzilla-daemon
2018-09-26  8:48 ` bugzilla-daemon
2018-09-26  9:13 ` bugzilla-daemon
2018-09-26  9:45 ` bugzilla-daemon
2018-09-29  1:58 ` bugzilla-daemon
2018-10-07  1:50 ` bugzilla-daemon
2018-10-16  1:48 ` bugzilla-daemon

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=bug-200871-202145-kpJwqgA3Pl@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.