diff mbox

[v2,26/35] ubifs: free quota inode information in ubifs_evict_inode

Message ID 1438235311-23788-27-git-send-email-yangds.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang Dongsheng July 30, 2015, 5:48 a.m. UTC
In evict, we have to call dquot_free_inode() to tell quota
subsystem there is one inode to be free. Please update the
quota information.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 fs/ubifs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Richard Weinberger Aug. 8, 2015, 9:51 p.m. UTC | #1
Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
> In evict, we have to call dquot_free_inode() to tell quota
> subsystem there is one inode to be free. Please update the
> quota information.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>  fs/ubifs/super.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 06dd7af..20500f0 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -361,6 +361,7 @@ static void ubifs_evict_inode(struct inode *inode)
>  	if (is_bad_inode(inode))
>  		goto out;
>  
> +	dquot_initialize(inode);
>  	ui->ui_size = inode->i_size = 0;
>  	err = ubifs_jnl_delete_inode(c, inode);
>  	if (err)
> @@ -370,7 +371,7 @@ static void ubifs_evict_inode(struct inode *inode)
>  		 */
>  		ubifs_err(c, "can't delete inode %lu, error %d",
>  			  inode->i_ino, err);
> -
> +	dquot_free_inode(inode);
>  out:
>  	if (ui->dirty)
>  		ubifs_release_dirty_inode_budget(c, ui);
> @@ -380,6 +381,7 @@ out:
>  		smp_wmb();
>  	}
>  done:
> +	dquot_drop(inode);

Is it allowed to call this without a dquot_initialize()?
The if (inode->i_nlink) branch will hit that condition.

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yang Dongsheng Aug. 10, 2015, 3:09 a.m. UTC | #2
On 08/09/2015 05:51 AM, Richard Weinberger wrote:
> Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
>> In evict, we have to call dquot_free_inode() to tell quota
>> subsystem there is one inode to be free. Please update the
>> quota information.
>>
>> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
>> ---
>>   fs/ubifs/super.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
>> index 06dd7af..20500f0 100644
>> --- a/fs/ubifs/super.c
>> +++ b/fs/ubifs/super.c
>> @@ -361,6 +361,7 @@ static void ubifs_evict_inode(struct inode *inode)
>>   	if (is_bad_inode(inode))
>>   		goto out;
>>
>> +	dquot_initialize(inode);
>>   	ui->ui_size = inode->i_size = 0;
>>   	err = ubifs_jnl_delete_inode(c, inode);
>>   	if (err)
>> @@ -370,7 +371,7 @@ static void ubifs_evict_inode(struct inode *inode)
>>   		 */
>>   		ubifs_err(c, "can't delete inode %lu, error %d",
>>   			  inode->i_ino, err);
>> -
>> +	dquot_free_inode(inode);
>>   out:
>>   	if (ui->dirty)
>>   		ubifs_release_dirty_inode_budget(c, ui);
>> @@ -380,6 +381,7 @@ out:
>>   		smp_wmb();
>>   	}
>>   done:
>> +	dquot_drop(inode);
>
> Is it allowed to call this without a dquot_initialize()?
> The if (inode->i_nlink) branch will hit that condition.

Yes, that's intentional. If (inode->i_nlink), we should
just call dquot_drop(). else, we have to dquot_initialize()->
dquot_free_inode()->dquot_drop();

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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 06dd7af..20500f0 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -361,6 +361,7 @@  static void ubifs_evict_inode(struct inode *inode)
 	if (is_bad_inode(inode))
 		goto out;
 
+	dquot_initialize(inode);
 	ui->ui_size = inode->i_size = 0;
 	err = ubifs_jnl_delete_inode(c, inode);
 	if (err)
@@ -370,7 +371,7 @@  static void ubifs_evict_inode(struct inode *inode)
 		 */
 		ubifs_err(c, "can't delete inode %lu, error %d",
 			  inode->i_ino, err);
-
+	dquot_free_inode(inode);
 out:
 	if (ui->dirty)
 		ubifs_release_dirty_inode_budget(c, ui);
@@ -380,6 +381,7 @@  out:
 		smp_wmb();
 	}
 done:
+	dquot_drop(inode);
 	clear_inode(inode);
 }