linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] UBIFS: Remove bogus assert
@ 2014-09-19  9:48 Richard Weinberger
  2014-09-19  9:48 ` [PATCH 2/2] UBI: Improve comment on work_sem Richard Weinberger
  2014-09-19 15:15 ` [PATCH 1/2] UBIFS: Remove bogus assert Artem Bityutskiy
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Weinberger @ 2014-09-19  9:48 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, linux-kernel, Richard Weinberger

This assertion was only correct before UBIFS had xattr support.
Now with xattr support also a directory node can carry data
and can act as host node.

Suggested-by: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/journal.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 0e045e7..fb166e2 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -546,15 +546,14 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
 	int aligned_dlen, aligned_ilen, sync = IS_DIRSYNC(dir);
 	int last_reference = !!(deletion && inode->i_nlink == 0);
 	struct ubifs_inode *ui = ubifs_inode(inode);
-	struct ubifs_inode *dir_ui = ubifs_inode(dir);
+	struct ubifs_inode *host_ui = ubifs_inode(dir);
 	struct ubifs_dent_node *dent;
 	struct ubifs_ino_node *ino;
 	union ubifs_key dent_key, ino_key;
 
 	dbg_jnl("ino %lu, dent '%.*s', data len %d in dir ino %lu",
 		inode->i_ino, nm->len, nm->name, ui->data_len, dir->i_ino);
-	ubifs_assert(dir_ui->data_len == 0);
-	ubifs_assert(mutex_is_locked(&dir_ui->ui_mutex));
+	ubifs_assert(mutex_is_locked(&host_ui->ui_mutex));
 
 	dlen = UBIFS_DENT_NODE_SZ + nm->len + 1;
 	ilen = UBIFS_INO_NODE_SZ;
@@ -658,7 +657,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
 	ui->synced_i_size = ui->ui_size;
 	spin_unlock(&ui->ui_lock);
 	mark_inode_clean(c, ui);
-	mark_inode_clean(c, dir_ui);
+	mark_inode_clean(c, host_ui);
 	return 0;
 
 out_finish:
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] UBI: Improve comment on work_sem
  2014-09-19  9:48 [PATCH 1/2] UBIFS: Remove bogus assert Richard Weinberger
@ 2014-09-19  9:48 ` Richard Weinberger
  2014-09-19 15:15 ` [PATCH 1/2] UBIFS: Remove bogus assert Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2014-09-19  9:48 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, linux-kernel, Richard Weinberger

Make clear what work_sem really does.

Suggested-by: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/ubi.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 7bf4163..f2933df 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -439,7 +439,8 @@ struct ubi_debug_info {
  *	     @move_to, @move_to_put @erase_pending, @wl_scheduled, @works,
  *	     @erroneous, and @erroneous_peb_count fields
  * @move_mutex: serializes eraseblock moves
- * @work_sem: synchronizes the WL worker with use tasks
+ * @work_sem: used to wait for all the scheduled works to finish and prevent
+ * new works from being submitted
  * @wl_scheduled: non-zero if the wear-leveling was scheduled
  * @lookuptbl: a table to quickly find a &struct ubi_wl_entry object for any
  *             physical eraseblock
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] UBIFS: Remove bogus assert
  2014-09-19  9:48 [PATCH 1/2] UBIFS: Remove bogus assert Richard Weinberger
  2014-09-19  9:48 ` [PATCH 2/2] UBI: Improve comment on work_sem Richard Weinberger
@ 2014-09-19 15:15 ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2014-09-19 15:15 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd, linux-kernel

On Fri, 2014-09-19 at 11:48 +0200, Richard Weinberger wrote:
> This assertion was only correct before UBIFS had xattr support.
> Now with xattr support also a directory node can carry data
> and can act as host node.
> 
> Suggested-by: Artem Bityutskiy <dedekind1@gmail.com>
> Signed-off-by: Richard Weinberger <richard@nod.at>

Pushed both, thank you!

-- 
Best Regards,
Artem Bityutskiy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-19 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19  9:48 [PATCH 1/2] UBIFS: Remove bogus assert Richard Weinberger
2014-09-19  9:48 ` [PATCH 2/2] UBI: Improve comment on work_sem Richard Weinberger
2014-09-19 15:15 ` [PATCH 1/2] UBIFS: Remove bogus assert Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).