Colin King | 4 Jun 18:57 2015

[PATCH] jfs: fix indentation on if statement

From: Colin Ian King <colin.king <at>>

The if statement and closing brace are indented by 1
extra space, so remove this extra spacing.  Cosmetic
change only.

Signed-off-by: Colin Ian King <colin.king <at>>
 fs/jfs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 070dc4b..28d69fa 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
 <at>  <at>  -133,11 +133,11  <at>  <at>  int jfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 	 * It has been committed since the last change, but was still
 	 * on the dirty inode list.
-	 if (!test_cflag(COMMIT_Dirty, inode)) {
+	if (!test_cflag(COMMIT_Dirty, inode)) {
 		/* Make sure committed changes hit the disk */
 		jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
 		return 0;
-	 }
+	}

 	if (jfs_commit_inode(inode, wait)) {
 		jfs_err("jfs_write_inode: jfs_commit_inode failed!");

(Continue reading)

Nan Jia | 31 May 11:53 2015

[PATCH] fs: jfs: file: removed a prohibited space after opening parenthesis

Fixed a coding style issue.

Signed-off-by: Nan Jia <jiananmail <at>>
 fs/jfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index e98d39d..b9dc23c 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
 <at>  <at>  -76,7 +76,7  <at>  <at>  static int jfs_open(struct inode *inode, struct file *file)
 		if (ji->active_ag == -1) {
 			struct jfs_sb_info *jfs_sb = JFS_SBI(inode->i_sb);
 			ji->active_ag = BLKTOAG(addressPXD(&ji->ixpxd), jfs_sb);
-			atomic_inc( &jfs_sb->bmap->db_active[ji->active_ag]);
+			atomic_inc(&jfs_sb->bmap->db_active[ji->active_ag]);


Felipe Monteiro de Carvalho | 22 Apr 13:09 2015

Strange dir inode


I've been working hard to get jfs read support in my software, and I
try as hard as possible to figure out myself without asking question,
but there is a very strange point where I got stuck =( Its a dir
inode, which has 10.000 files inside it.

inode nr 12291 and offset 0x600460 presents us the following basic
inode information:

di_fileset $10
di_number $303
di_gen $2A
di_size = $14000
di_nblocks = $140
di_nlink = 2
di_uid = 0
di_gid = 0
di_mode = $200041FF
di_next_index = $B0100
di_acltype = 0

DASD = zeroes
nextindex = 1
freecnt: int8 = 7
freelistt: int8 = 2
(Continue reading)

Felipe Monteiro de Carvalho | 15 Apr 11:27 2015

Cannot Find the Root Inode of a JFS Disk


I am implementing a software to read JFS partitions in Windows/Mac OS
X. Only reading, no writing involved.

It works already for many partitions, but someone sent me a disk, and
this is something wrong with my interpretation of the JFS
documentation or something like that, because for this particular
disk, it doesn't work =(

I read in this order:

1> Aggregate Map -> Always from offset A000

2> Fileset zero inode -> Always from offset D000

Here I read _xtroot: xtpage_t; in this inode to obtain the next
address. See the screenshot:

And the data that I read here (data in the comments):

xtpage_t->xtpage_t = packed record
xtpage_t->case Integer of 0: (
// struct xtheader {
xtpage_t->next: le64; //  0
xtpage_t->prev: le64; //  0
xtpage_t->flag: Byte; //  $85
xtpage_t->rsrvd1: Byte; //  0
(Continue reading)

Dave Kleikamp | 14 Apr 17:46 2015

[GIT PULL] jfs changes for v4.1

Not much this time. Just a one-liner.

The following changes since commit 09d35919b06e8508b51ee8a643a67b56f7bea0dd:

  Merge branch 'i2c/for-current' of git://
(2015-03-12 09:50:45 -0700)

are available in the git repository at:

  git:// tags/jfs-4.1

for you to fetch changes up to 7d2ac45611b072a24e5014a56a65e6be31c1f884:

  jfs: %pf is only for function pointers (2015-03-12 12:32:19 -0500)

Just a one-liner format fix

Scott Wood (1):
      jfs: %pf is only for function pointers

 fs/jfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises event?utm_
(Continue reading)

Andrey Ryabinin | 3 Apr 16:47 2015

[PATCH] mm, mempool: kasan: poison mempool elements

Mempools keep allocated objects in reserved for situations
when ordinary allocation may not be possible to satisfy.
These objects shouldn't be accessed before they leave
the pool.
This patch poison elements when get into the pool
and unpoison when they leave it. This will let KASan
to detect use-after-free of mempool's elements.

Signed-off-by: Andrey Ryabinin <a.ryabinin <at>>
 include/linux/kasan.h |  2 ++
 mm/kasan/kasan.c      | 13 +++++++++++++
 mm/mempool.c          | 23 +++++++++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index 5bb0744..5486d77 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
 <at>  <at>  -44,6 +44,7  <at>  <at>  void kasan_poison_object_data(struct kmem_cache *cache, void *object);

 void kasan_kmalloc_large(const void *ptr, size_t size);
 void kasan_kfree_large(const void *ptr);
+void kasan_kfree(void *ptr);
 void kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size);
 void kasan_krealloc(const void *object, size_t new_size);

 <at>  <at>  -71,6 +72,7  <at>  <at>  static inline void kasan_poison_object_data(struct kmem_cache *cache,

 static inline void kasan_kmalloc_large(void *ptr, size_t size) {}
(Continue reading)

David Rientjes | 25 Mar 00:08 2015

[patch 1/4] fs, jfs: remove slab object constructor

Mempools based on slab caches with object constructors are risky because
element allocation can happen either from the slab cache itself, meaning
the constructor is properly called before returning, or from the mempool
reserve pool, meaning the constructor is not called before returning,
depending on the allocation context.

For this reason, we should disallow creating mempools based on slab
caches that have object constructors.  Callers of mempool_alloc() will
be responsible for properly initializing the returned element.

Then, it doesn't matter if the element came from the slab cache or the
mempool reserved pool.

The only occurrence of a mempool being based on a slab cache with an
object constructor in the tree is in fs/jfs/jfs_metapage.c.  Remove it
and properly initialize the element in alloc_metapage().

At the same time, META_free is never used, so remove it as well.

Signed-off-by: David Rientjes <rientjes <at>>
 fs/jfs/jfs_metapage.c | 31 ++++++++++++-------------------
 fs/jfs/jfs_metapage.h |  1 -
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
 <at>  <at>  -183,30 +183,23  <at>  <at>  static inline void remove_metapage(struct page *page, struct metapage *mp)

(Continue reading)

Dave Kleikamp | 23 Mar 22:06 2015

[PATCH][3.2.y][3.4.y][3.10.y] jfs: fix readdir regression

Upstream commit 44512449, "jfs: fix readdir cookie incompatibility
with NFSv4", was backported incorrectly into the stable trees which
used the filldir callback (rather than dir_emit). The position is
being incorrectly passed to filldir for the . and .. entries.

The still-maintained stable trees that need to be fixed are 3.2.y,
3.4.y and 3.10.y.

Signed-off-by: Dave Kleikamp <dave.kleikamp <at>>
Cc: jfs-discussion <at>
Cc: stable <at>
 fs/jfs/jfs_dtree.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 9f7c758..f6f32fa 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
 <at>  <at>  -3103,7 +3103,7  <at>  <at>  int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 				 * self "."
 				filp->f_pos = 1;
-				if (filldir(dirent, ".", 1, 0, ip->i_ino,
+				if (filldir(dirent, ".", 1, 1, ip->i_ino,
 					return 0;
(Continue reading)

Richard Weinberger | 21 Mar 00:33 2015

JFS readdir() issues in stable 3.2


Mainline commit 44512449c0ab368889dd13ae0031fba74ee7e1d2
(jfs: fix readdir cookie incompatibility with NFSv4) does not work as expected on 3.2.
Maybe on other stable kernels too.

UML stumbled over it:

If you run the attached readdir.c on a JFS on stable 3.2.51+ readdir() will not
increment the directory offset nor return NULL, hence the caller will loop forever.
It looks like if the current directory offset is > 0 and you run seekdir(telldir())
the next readdir() call will not increment it.

Dave, has your fix some unnamed dependencies which need backporting too?

Attachment (readdir.c): text/x-csrc, 442 bytes
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now.
Jfs-discussion mailing list
(Continue reading)

Omar Sandoval | 16 Mar 12:33 2015

[RFC PATCH 0/5] Remove rw parameter from direct_IO()


Al, here's some cleanup that you mentioned back in December that I got
around to (

In summary, the rw parameter to a_ops->direct_IO() is redundant with
.type in struct iov_iter. Additionally, rw is inconsistently checked for
being a WRITE; some filesystems do rw == WRITE, others do rw & WRITE,
and others do both within the same function :) The distinction is that
swapout may OR in the ITER_BVEC flag in the rw passed to ->direct_IO(),
so the two are not equivalent (although this really only happens for
swap-over-NFS, but it's scary nonetheless). After looking through all of
these, it definitely looks like every check means for ANY write, not
just non-kernel writes.

So, the solution presented here is:

- Add a helper, iov_iter_rw(), which always returns either READ or
  WRITE, no ITER_.* or REQ_.* nonsense mixed in. For consistency, the
  return value is always checked for equality
- Get rid of all uses of rw in any implementations of direct_IO,
  starting with the generic code
- Nuke the actual parameter and update the documentation

I decided to squish all of the filesystems together in patch 4 to avoid
inundating the mailing lists with 20+ mostly two-line patches, but I can
split those out if that's any better. Additionally, patch 1 pulls fs.h
into uio.h, which seems undesirable.

These were mostly just compile tested, with a couple of direct I/O
(Continue reading)

Rasmus Villemoes | 19 Mar 12:28 2015

[PATCH] fs: cleanup slight list_entry abuse

list_entry is just a wrapper for container_of, but it is arguably
wrong (and slightly confusing) to use it when the pointed-to struct
member is not a struct list_head. Use container_of directly instead.

Signed-off-by: Rasmus Villemoes <linux <at>>
Most of these predate git. If I'm the only one who has been confused
by this in 10 years, maybe it's not worth the churn.

 fs/affs/affs.h              | 2 +-
 fs/befs/befs.h              | 2 +-
 fs/coda/coda_linux.h        | 2 +-
 fs/hfs/hfs_fs.h             | 2 +-
 fs/hfsplus/hfsplus_fs.h     | 2 +-
 fs/hpfs/hpfs_fn.h           | 2 +-
 fs/jffs2/os-linux.h         | 2 +-
 fs/jfs/jfs_incore.h         | 2 +-
 fs/minix/minix.h            | 2 +-
 fs/ntfs/inode.h             | 2 +-
 fs/squashfs/squashfs_fs_i.h | 2 +-
 fs/sysv/sysv.h              | 2 +-
 fs/udf/udf_i.h              | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/affs/affs.h b/fs/affs/affs.h
index c8764bd7497d..64469527d445 100644
--- a/fs/affs/affs.h
+++ b/fs/affs/affs.h
 <at>  <at>  -64,7 +64,7  <at>  <at>  struct affs_inode_info {
 /* short cut to get to the affs specific inode data */
(Continue reading)