[Deepin-Kernel-SIG] [linux-6.6.y] [Upstream] exfat: Implement sops->shutdown and ioctl #476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mainline inclusion
from mainline-v6.12-rc1
[ Upstream commit f761fcdd289d07e8547fef7ac76c3760fc7803f2 ]
We found that when writing a large file through buffer write, if the disk is inaccessible, exFAT does not return an error normally, which leads to the writing process not stopping properly.
To easily reproduce this issue, you can follow the steps below:
You may find that the dd process does not stop immediately and may continue for a long time.
The root cause of this issue is that during buffer write process, exFAT does not need to access the disk to look up directory entries or the FAT table (whereas FAT would do) every time data is written. Instead, exFAT simply marks the buffer as dirty and returns, delegating the writeback operation to the writeback process.
If the disk cannot be accessed at this time, the error will only be returned to the writeback process, and the original process will not receive the error, so it cannot be returned to the user side.
When the disk cannot be accessed normally, an error should be returned to stop the writing process.
Implement sops->shutdown and ioctl to shut down the file system when underlying block device is marked dead.
Signed-off-by: Dongliang Cui [email protected]
Signed-off-by: Zhiguo Niu [email protected]
Signed-off-by: Namjae Jeon [email protected]
(cherry picked from commit f761fcdd289d07e8547fef7ac76c3760fc7803f2)
[dongliang.cui: bdev_freeze & bdev_thaw has a different name in k66
and mainline, make adaptation modifications.
Resolve conflicts in 'fs/exfat/inode.c' and 'fs/exfat/namei.c'.]
Change-Id: Icb7ece39d885cded6d54557c382e84b222f8cada
Signed-off-by: dongliang.cui [email protected]
(cherry picked from commit 3326d8c45d52d83bd6dd57405e99c1f6938ce18f)