linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 217605] New: unttached inode after power cut with orphan file feature enabled
@ 2023-06-28 13:19 bugzilla-daemon
  2023-06-28 13:19 ` [Bug 217605] " bugzilla-daemon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2023-06-28 13:19 UTC (permalink / raw)
  To: linux-ext4

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

            Bug ID: 217605
           Summary: unttached inode after power cut with orphan file
                    feature enabled
           Product: File System
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: ext4
          Assignee: fs_ext4@kernel-bugs.osdl.org
          Reporter: chengzhihao1@huawei.com
        Regression: No

Running generic/475(filesystem consistent tests after power cut) could
    easily trigger unattached inode error while doing fsck:
      Unattached zero-length inode 39405.  Clear? no

      Unattached inode 39405
      Connect to /lost+found? no

    Above inconsistence is caused by following process:
           P1                       P2
    ext4_create
     inode = ext4_new_inode_start_handle  // itable records nlink=1
     ext4_add_nondir
       err = ext4_add_entry  // ENOSPC
        ext4_append
         ext4_bread
          ext4_getblk
           ext4_map_blocks // returns ENOSPC
       drop_nlink(inode) // won't be updated into disk inode
       ext4_orphan_add(handle, inode)
        ext4_orphan_file_add
     ext4_journal_stop(handle)
                          jbd2_journal_commit_transaction // commit success
                  >> power cut <<
    ext4_fill_super
     ext4_load_and_init_journal   // itable records nlink=1
     ext4_orphan_cleanup
      ext4_process_orphan
       if (inode->i_nlink)        // true, inode won't be deleted

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 217605] unttached inode after power cut with orphan file feature enabled
  2023-06-28 13:19 [Bug 217605] New: unttached inode after power cut with orphan file feature enabled bugzilla-daemon
@ 2023-06-28 13:19 ` bugzilla-daemon
  2023-06-28 13:20 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2023-06-28 13:19 UTC (permalink / raw)
  To: linux-ext4

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

--- Comment #1 from Zhihao Cheng (chengzhihao1@huawei.com) ---
reproducer:
1. ./test.sh
[   73.704796] inject err for ino 13 creation
[   73.705523] wait commit journal
[   75.741472] commit trans
[   76.550550] reboot: Restarting system

2. mount /dev/sda temp
   umount temp
[   82.683096] orphan replay: reserve 13

3. fsck.ext4 -fn /dev/sda
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Unattached zero-length inode 13.  Clear? no

Unattached inode 13
Connect to /lost+found? no

Pass 5: Checking group summary information

/dev/sda: ********** WARNING: Filesystem still has errors **********

/dev/sda: 13/25584 files (0.0% non-contiguous), 12113/102400 block

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 217605] unttached inode after power cut with orphan file feature enabled
  2023-06-28 13:19 [Bug 217605] New: unttached inode after power cut with orphan file feature enabled bugzilla-daemon
  2023-06-28 13:19 ` [Bug 217605] " bugzilla-daemon
@ 2023-06-28 13:20 ` bugzilla-daemon
  2023-06-28 13:20 ` bugzilla-daemon
  2023-06-28 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2023-06-28 13:20 UTC (permalink / raw)
  To: linux-ext4

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

--- Comment #2 from Zhihao Cheng (chengzhihao1@huawei.com) ---
Created attachment 304497
  --> https://bugzilla.kernel.org/attachment.cgi?id=304497&action=edit
diff

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 217605] unttached inode after power cut with orphan file feature enabled
  2023-06-28 13:19 [Bug 217605] New: unttached inode after power cut with orphan file feature enabled bugzilla-daemon
  2023-06-28 13:19 ` [Bug 217605] " bugzilla-daemon
  2023-06-28 13:20 ` bugzilla-daemon
@ 2023-06-28 13:20 ` bugzilla-daemon
  2023-06-28 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2023-06-28 13:20 UTC (permalink / raw)
  To: linux-ext4

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

--- Comment #3 from Zhihao Cheng (chengzhihao1@huawei.com) ---
Created attachment 304498
  --> https://bugzilla.kernel.org/attachment.cgi?id=304498&action=edit
test.sh

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 217605] unttached inode after power cut with orphan file feature enabled
  2023-06-28 13:19 [Bug 217605] New: unttached inode after power cut with orphan file feature enabled bugzilla-daemon
                   ` (2 preceding siblings ...)
  2023-06-28 13:20 ` bugzilla-daemon
@ 2023-06-28 13:20 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2023-06-28 13:20 UTC (permalink / raw)
  To: linux-ext4

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

--- Comment #4 from Zhihao Cheng (chengzhihao1@huawei.com) ---
(In reply to Zhihao Cheng from comment #1)

Apply diff first of all

> reproducer:
> 1. ./test.sh
> [   73.704796] inject err for ino 13 creation
> [   73.705523] wait commit journal
> [   75.741472] commit trans
> [   76.550550] reboot: Restarting system
> 
> 2. mount /dev/sda temp
>    umount temp
> [   82.683096] orphan replay: reserve 13
> 
> 3. fsck.ext4 -fn /dev/sda
> e2fsck 1.47.0 (5-Feb-2023)
> Pass 1: Checking inodes, blocks, and sizes
> Pass 2: Checking directory structure
> Pass 3: Checking directory connectivity
> Pass 4: Checking reference counts
> Unattached zero-length inode 13.  Clear? no
> 
> Unattached inode 13
> Connect to /lost+found? no
> 
> Pass 5: Checking group summary information
> 
> /dev/sda: ********** WARNING: Filesystem still has errors **********
> 
> /dev/sda: 13/25584 files (0.0% non-contiguous), 12113/102400 block

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-28 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 13:19 [Bug 217605] New: unttached inode after power cut with orphan file feature enabled bugzilla-daemon
2023-06-28 13:19 ` [Bug 217605] " bugzilla-daemon
2023-06-28 13:20 ` bugzilla-daemon
2023-06-28 13:20 ` bugzilla-daemon
2023-06-28 13:20 ` bugzilla-daemon

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).