Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3712b9d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
There are few important bug fixes for LogFS

* tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
  Logfs: Allow NULL block_isbad() methods
  logfs: Grow inode in delete path
  logfs: Free areas before calling generic_shutdown_super()
  logfs: remove useless BUG_ON
  MAINTAINERS: Add Prasad Joshi in LogFS maintiners
  logfs: Propagate page parameter to __logfs_write_inode
  logfs: set superblock shutdown flag after generic sb shutdown
  logfs: take write mutex lock during fsync and sync
  logfs: Prevent memory corruption
  logfs: update page reference count for pined pages

Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
"mtd->block_isbad" means in commit f2933e86: "Logfs: Allow NULL
block_isbad() methods" clashing with the abstraction changes in the
commits 7086c19d: "mtd: introduce mtd_block_isbad interface" and
d58b27ed: "logfs: do not use 'mtd->block_isbad' directly".

This resolution takes the semantics from commit f2933e86, and just
makes mtd_block_isbad() return zero (false) if the 'block_isbad'
function is NULL.  But that also means that now "mtd_can_have_bb()"
always returns 0.

Now, "mtd_block_markbad()" will obviously return an error if the
low-level driver doesn't support bad blocks, so this is somewhat
non-symmetric, but it actually makes sense if a NULL "block_isbad"
function is considered to mean "I assume that all my blocks are always
good".
parents c5d2bc11 f2933e86
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4140,6 +4140,7 @@ F: fs/partitions/ldm.*

LogFS
M:	Joern Engel <joern@logfs.org>
M:	Prasad Joshi <prasadjoshi.linux@gmail.com>
L:	logfs@logfs.org
W:	logfs.org
S:	Maintained
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static int write_dir(struct inode *dir, struct logfs_disk_dentry *dd,

static int write_inode(struct inode *inode)
{
	return __logfs_write_inode(inode, WF_LOCK);
	return __logfs_write_inode(inode, NULL, WF_LOCK);
}

static s64 dir_seek_data(struct inode *inode, s64 pos)
+2 −0
Original line number Diff line number Diff line
@@ -230,7 +230,9 @@ int logfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
		return ret;

	mutex_lock(&inode->i_mutex);
	logfs_get_wblocks(sb, NULL, WF_LOCK);
	logfs_write_anchor(sb);
	logfs_put_wblocks(sb, NULL, WF_LOCK);
	mutex_unlock(&inode->i_mutex);

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ static struct gc_candidate *get_candidate(struct super_block *sb)
	int i, max_dist;
	struct gc_candidate *cand = NULL, *this;

	max_dist = min(no_free_segments(sb), LOGFS_NO_AREAS);
	max_dist = min(no_free_segments(sb), LOGFS_NO_AREAS - 1);

	for (i = max_dist; i >= 0; i--) {
		this = first_in_list(&super->s_low_list[i]);
+3 −1
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ static int logfs_write_inode(struct inode *inode, struct writeback_control *wbc)
	if (logfs_inode(inode)->li_flags & LOGFS_IF_STILLBORN)
		return 0;

	ret = __logfs_write_inode(inode, flags);
	ret = __logfs_write_inode(inode, NULL, flags);
	LOGFS_BUG_ON(ret, inode->i_sb);
	return ret;
}
@@ -363,7 +363,9 @@ static void logfs_init_once(void *_li)

static int logfs_sync_fs(struct super_block *sb, int wait)
{
	logfs_get_wblocks(sb, NULL, WF_LOCK);
	logfs_write_anchor(sb);
	logfs_put_wblocks(sb, NULL, WF_LOCK);
	return 0;
}

Loading