[lustre-devel] [PATCH 20/22] ext4: use GFP_NOFS in ext4_inode_attach_jinode

Andreas Dilger adilger at whamcloud.com
Mon Jul 22 18:56:56 PDT 2019


That interface has only existed for a handful of kernel releases, so was/is
not a viable option for earlier kernels. 

Cheers, Andreas

> On Jul 21, 2019, at 23:31, NeilBrown <neilb at suse.com> wrote:
> 
> On Sun, Jul 21 2019, James Simmons wrote:
> 
> If you need to call this from a context where GFP_KERNEL is not safe,
> use memalloc_nofs_{save,restore}().
> 
> NeilBrown
> 
> 
> 
>> Signed-off-by: James Simmons <jsimmons at infradead.org>
>> ---
>> fs/ext4/inode.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
>> index bf00dfc..ca72097 100644
>> --- a/fs/ext4/inode.c
>> +++ b/fs/ext4/inode.c
>> @@ -4422,7 +4422,7 @@ int ext4_inode_attach_jinode(struct inode *inode)
>>    if (ei->jinode || !EXT4_SB(inode->i_sb)->s_journal)
>>        return 0;
>> 
>> -    jinode = jbd2_alloc_inode(GFP_KERNEL);
>> +    jinode = jbd2_alloc_inode(GFP_NOFS);
>>    spin_lock(&inode->i_lock);
>>    if (!ei->jinode) {
>>        if (!jinode) {
>> -- 
>> 1.8.3.1


More information about the lustre-devel mailing list