@@ -39,6 +39,7 @@
#include <linux/bitops.h>
#include <linux/init_task.h>
#include <linux/uaccess.h>
+#include <linux/sched/mm.h>
#include "internal.h"
#include "mount.h"
@@ -4797,7 +4798,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
int err;
unsigned int flags = 0;
if (nofs)
- flags |= AOP_FLAG_NOFS;
+ flags = memalloc_nofs_save();
retry:
err = pagecache_write_begin(NULL, mapping, 0, len-1,
@@ -4815,8 +4816,12 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
goto retry;
mark_inode_dirty(inode);
+ if (nofs)
+ memalloc_nofs_restore(flags);
return 0;
fail:
+ if (nofs)
+ memalloc_nofs_restore(flags);
return err;
}
EXPORT_SYMBOL(__page_symlink);