We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35c1576 commit 76c3819Copy full SHA for 76c3819
fs/btrfs/sysfs.c
@@ -10,6 +10,7 @@
10
#include <linux/kobject.h>
11
#include <linux/bug.h>
12
#include <linux/debugfs.h>
13
+#include <linux/sched/mm.h>
14
15
#include "ctree.h"
16
#include "disk-io.h"
@@ -766,7 +767,9 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
766
767
{
768
int error = 0;
769
struct btrfs_device *dev;
770
+ unsigned int nofs_flag;
771
772
+ nofs_flag = memalloc_nofs_save();
773
list_for_each_entry(dev, &fs_devices->devices, dev_list) {
774
struct hd_struct *disk;
775
struct kobject *disk_kobj;
@@ -785,6 +788,7 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
785
788
if (error)
786
789
break;
787
790
}
791
+ memalloc_nofs_restore(nofs_flag);
792
793
return error;
794
0 commit comments