[PATCH v2 25/35] ubifs: record quota information about inode in ubifs_new_inode

Dongsheng Yang yangds.fnst at cn.fujitsu.com
Sun Aug 9 19:13:04 PDT 2015


On 08/09/2015 05:43 AM, Richard Weinberger wrote:
> Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
>> Initialize quota and alloc a inode quota information in
>> ubifs_new_inode(). Then quota would be aware of a new
>> inode is allocated.
>>
>> Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
>> ---
>>   fs/ubifs/dir.c | 20 +++++++++++++++++---
>>   1 file changed, 17 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
>> index 8d93427..5bfce44 100644
>> --- a/fs/ubifs/dir.c
>> +++ b/fs/ubifs/dir.c
>> @@ -41,6 +41,7 @@
>>    */
>>
>>   #include "ubifs.h"
>> +#include <linux/quotaops.h>
>>
>>   /**
>>    * inherit_flags - inherit flags of the parent inode.
>> @@ -90,12 +91,13 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
>>   {
>>   	struct inode *inode;
>>   	struct ubifs_inode *ui;
>> +	int err = 0;
>>
>>   	inode = new_inode(c->vfs_sb);
>> -	ui = ubifs_inode(inode);
>>   	if (!inode)
>>   		return ERR_PTR(-ENOMEM);
>>
>> +	ui = ubifs_inode(inode);
>
> Seems like an unrelated change.
> All ubifs_inode() does is a container_of(), inode = NULL won't hurt.

My bad, I planed to split this patch, but forgot it.

Yes, as you said, inode = NULL won't hurt, but I think checking inode
following new_inode() directly before using it seems more reasonable.
Although it's obvious that's okey to experts like you, I
believe this change could make the logic more "correct" to others. :)

It's a trivial fix from my opinion, do you think that's worthy?

Yang
>
> Thanks,
> //richard
> .
>




More information about the linux-mtd mailing list