Hi Richard,
Thanx for your review. I decide to drop it in next version. :)
Thanx
Yang
On 08/04/2015 05:13 AM, Richard Weinberger wrote:
Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
In ubifs, we have to do a budget for inode before marking
it as dirty. But sometimes, we would call dirty_inode in vfs
which will not do a budget for inode. In this case, we have
to do a budget in ubifs_dirty_inode() by ourselvies.
How is this commit related to quota support?
Signed-off-by: Dongsheng Yang <yangds.fnst@xxxxxxxxxxxxxx>
---
fs/ubifs/super.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 2491fff..bc57685 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -383,15 +383,38 @@ done:
clear_inode(inode);
}
+/*
+ * In theory, ubifs should take the full control of dirty<->clean
+ * of an inode with ui->ui_mutex. But there are callers of
+ * ubifs_dirty_inode in vfs without holding ui->ui_mutex and
+ * budgeting. So when we found the ui_mutex is not locked, we have
+ * to lock ui->ui_mutex by itself and do a budget by itself.
+ */
static void ubifs_dirty_inode(struct inode *inode, int flags)
{
struct ubifs_inode *ui = ubifs_inode(inode);
+ int locked = mutex_is_locked(&ui->ui_mutex);
+ struct ubifs_info *c = inode->i_sb->s_fs_info;
+ int ret = 0;
+
+ if (!locked)
+ mutex_lock(&ui->ui_mutex);
- ubifs_assert(mutex_is_locked(&ui->ui_mutex));
So, currently this assert can be reached? How?
Thanks,
//richard
.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html