Files
Jaegeuk Kim afd4669f0a ANDROID: vfs/ext4,f2fs: finish umount(2) in time with filesystem work
This patch changes umount(2) flow to wait for delayed fput/mntput. Meanwhile,
we can still see unclosed name spaces which can trigger filesystem panic due
to released device illustrated below. (i.e., ext4 with errors=panic)

So, it introduces fs->umount_end() to change filesystem behavior like
error=remount-ro in ext4.

WARN: DO NOT upstream!

This is only related to Android reboot procedure, and resolves the below
issue where a kernel panic happens when a living filesystem tries to access
dead block device after device_shutdown done by kernel_restart.

Term: namespace(mnt_get_count())

1. create_new_namespaces() creates ns1 and ns2,

  /data(1)    ns1(1)    ns2(1)
    |          |          |
     ---------------------
               |
        sb->s_active = 3

2. after binder_proc_clear_zombies() for ns2 and ns1 triggers
  - delayed_fput()
    - delayed_mntput_work(ns2)

  /data(1)    ns1(1)
    |          |
     ----------
          |
    sb->s_active = 2

3. umount() for /data is successed.

  ns1(1)
    |
 sb->s_active = 1

4. device_shutdown() by init

5.  - delayed_mntput_work(ns1)
     - put_super(), since sb->s_active = 0
       - -EIO

Bug: 63981945
Bug: 65481582
Bug: 72236603
Change-Id: I7db02f480cc839bf9c245e078164a8168ea0d88b
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2023-03-26 12:09:04 +01:00
..
2022-04-12 08:16:55 +02:00
2022-10-26 13:15:43 +02:00
2022-08-25 12:09:51 +02:00
2021-10-06 10:40:17 +02:00
2018-09-26 08:44:01 +02:00
2018-02-28 10:18:33 +01:00
2018-04-11 13:28:37 -07:00
2020-04-20 17:09:10 +05:30
2017-11-15 19:00:12 +05:30
2017-12-10 17:14:07 +01:00
2021-11-26 12:41:38 +01:00
2021-02-23 14:46:12 +01:00
2021-02-03 23:19:50 +01:00
2021-03-30 14:41:41 +02:00
2019-08-11 15:30:44 +02:00
2018-10-10 08:53:18 +02:00
2019-05-08 07:46:34 +02:00
2017-10-30 09:27:09 +01:00
2021-11-26 11:48:18 +01:00
2019-05-21 19:03:22 +02:00
2021-07-11 12:46:40 +02:00
2020-10-29 10:17:40 +01:00
2019-11-14 14:28:42 +08:00
2020-03-20 09:07:43 +01:00
2019-09-03 13:45:29 -07:00
2020-04-02 17:20:39 +02:00
2022-09-28 11:12:52 +02:00
2019-09-03 13:45:40 -07:00
2021-03-07 11:40:25 +01:00
2018-11-13 11:17:02 -08:00
2022-10-26 13:28:31 +02:00
2021-03-24 11:32:14 +01:00
2022-06-25 11:45:10 +02:00
2018-09-10 09:20:19 +02:00
2020-04-02 17:20:39 +02:00
2021-12-14 10:04:48 +01:00
2018-08-23 12:05:06 -07:00
2021-03-07 11:40:25 +01:00
2018-08-23 12:05:06 -07:00