diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 1f6656c3d1b9..f05bed242422 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2811,18 +2811,23 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) | |||
2811 | } | 2811 | } |
2812 | } | 2812 | } |
2813 | 2813 | ||
2814 | int __page_symlink(struct inode *inode, const char *symname, int len, | 2814 | /* |
2815 | gfp_t gfp_mask) | 2815 | * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS |
2816 | */ | ||
2817 | int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) | ||
2816 | { | 2818 | { |
2817 | struct address_space *mapping = inode->i_mapping; | 2819 | struct address_space *mapping = inode->i_mapping; |
2818 | struct page *page; | 2820 | struct page *page; |
2819 | void *fsdata; | 2821 | void *fsdata; |
2820 | int err; | 2822 | int err; |
2821 | char *kaddr; | 2823 | char *kaddr; |
2824 | unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE; | ||
2825 | if (nofs) | ||
2826 | flags |= AOP_FLAG_NOFS; | ||
2822 | 2827 | ||
2823 | retry: | 2828 | retry: |
2824 | err = pagecache_write_begin(NULL, mapping, 0, len-1, | 2829 | err = pagecache_write_begin(NULL, mapping, 0, len-1, |
2825 | AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata); | 2830 | flags, &page, &fsdata); |
2826 | if (err) | 2831 | if (err) |
2827 | goto fail; | 2832 | goto fail; |
2828 | 2833 | ||
@@ -2846,7 +2851,7 @@ fail: | |||
2846 | int page_symlink(struct inode *inode, const char *symname, int len) | 2851 | int page_symlink(struct inode *inode, const char *symname, int len) |
2847 | { | 2852 | { |
2848 | return __page_symlink(inode, symname, len, | 2853 | return __page_symlink(inode, symname, len, |
2849 | mapping_gfp_mask(inode->i_mapping)); | 2854 | !(mapping_gfp_mask(inode->i_mapping) & __GFP_FS)); |
2850 | } | 2855 | } |
2851 | 2856 | ||
2852 | const struct inode_operations page_symlink_inode_operations = { | 2857 | const struct inode_operations page_symlink_inode_operations = { |