mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 05:13:18 +00:00
Merge tag 'fs_for_v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull writeback and ext2 fixes from Jan Kara: "A fix for writeback bug which prevented machines with kdevtmpfs from booting and also one small ext2 bugfix in IO error handling" * tag 'fs_for_v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: init: Initialize noop_backing_dev_info early ext2: fix fs corruption when trying to remove a non-empty directory with IO error
This commit is contained in:
commit
5c0cd3d4a9
@ -8,6 +8,7 @@
|
|||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/memory.h>
|
#include <linux/memory.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
@ -20,6 +21,7 @@
|
|||||||
void __init driver_init(void)
|
void __init driver_init(void)
|
||||||
{
|
{
|
||||||
/* These are the core pieces */
|
/* These are the core pieces */
|
||||||
|
bdi_init(&noop_backing_dev_info);
|
||||||
devtmpfs_init();
|
devtmpfs_init();
|
||||||
devices_init();
|
devices_init();
|
||||||
buses_init();
|
buses_init();
|
||||||
|
@ -672,17 +672,14 @@ int ext2_empty_dir (struct inode * inode)
|
|||||||
void *page_addr = NULL;
|
void *page_addr = NULL;
|
||||||
struct page *page = NULL;
|
struct page *page = NULL;
|
||||||
unsigned long i, npages = dir_pages(inode);
|
unsigned long i, npages = dir_pages(inode);
|
||||||
int dir_has_error = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < npages; i++) {
|
for (i = 0; i < npages; i++) {
|
||||||
char *kaddr;
|
char *kaddr;
|
||||||
ext2_dirent * de;
|
ext2_dirent * de;
|
||||||
page = ext2_get_page(inode, i, dir_has_error, &page_addr);
|
page = ext2_get_page(inode, i, 0, &page_addr);
|
||||||
|
|
||||||
if (IS_ERR(page)) {
|
if (IS_ERR(page))
|
||||||
dir_has_error = 1;
|
goto not_empty;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
kaddr = page_addr;
|
kaddr = page_addr;
|
||||||
de = (ext2_dirent *)kaddr;
|
de = (ext2_dirent *)kaddr;
|
||||||
|
@ -119,6 +119,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
|
|||||||
|
|
||||||
extern struct backing_dev_info noop_backing_dev_info;
|
extern struct backing_dev_info noop_backing_dev_info;
|
||||||
|
|
||||||
|
int bdi_init(struct backing_dev_info *bdi);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* writeback_in_progress - determine whether there is writeback in progress
|
* writeback_in_progress - determine whether there is writeback in progress
|
||||||
* @wb: bdi_writeback of interest
|
* @wb: bdi_writeback of interest
|
||||||
|
@ -231,20 +231,13 @@ static __init int bdi_class_init(void)
|
|||||||
}
|
}
|
||||||
postcore_initcall(bdi_class_init);
|
postcore_initcall(bdi_class_init);
|
||||||
|
|
||||||
static int bdi_init(struct backing_dev_info *bdi);
|
|
||||||
|
|
||||||
static int __init default_bdi_init(void)
|
static int __init default_bdi_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
|
||||||
|
|
||||||
bdi_wq = alloc_workqueue("writeback", WQ_MEM_RECLAIM | WQ_UNBOUND |
|
bdi_wq = alloc_workqueue("writeback", WQ_MEM_RECLAIM | WQ_UNBOUND |
|
||||||
WQ_SYSFS, 0);
|
WQ_SYSFS, 0);
|
||||||
if (!bdi_wq)
|
if (!bdi_wq)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
return 0;
|
||||||
err = bdi_init(&noop_backing_dev_info);
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
subsys_initcall(default_bdi_init);
|
subsys_initcall(default_bdi_init);
|
||||||
|
|
||||||
@ -781,7 +774,7 @@ static void cgwb_remove_from_bdi_list(struct bdi_writeback *wb)
|
|||||||
|
|
||||||
#endif /* CONFIG_CGROUP_WRITEBACK */
|
#endif /* CONFIG_CGROUP_WRITEBACK */
|
||||||
|
|
||||||
static int bdi_init(struct backing_dev_info *bdi)
|
int bdi_init(struct backing_dev_info *bdi)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user