<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/gfs2/dir.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-30T03:49:28Z</updated>
<entry>
<title>gfs2: avoid uninitialized variable warning</title>
<updated>2017-04-30T03:49:28Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2016-01-26T18:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d39cb4a597295c6fd5e01795a134f1e3c0914049'/>
<id>urn:sha1:d39cb4a597295c6fd5e01795a134f1e3c0914049</id>
<content type='text'>
commit 67893f12e5374bbcaaffbc6e570acbc2714ea884 upstream.

We get a bogus warning about a potential uninitialized variable
use in gfs2, because the compiler does not figure out that we
never use the leaf number if get_leaf_nr() returns an error:

fs/gfs2/dir.c: In function 'get_first_leaf':
fs/gfs2/dir.c:802:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
fs/gfs2/dir.c: In function 'dir_split_leaf':
fs/gfs2/dir.c:1021:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]

Changing the 'if (!error)' to 'if (!IS_ERR_VALUE(error))' is
sufficient to let gcc understand that this is exactly the same
condition as in IS_ERR() so it can optimize the code path enough
to understand it.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>GFS2: Protect freeing directory hash table with i_lock spin_lock</title>
<updated>2015-11-04T18:05:42Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2015-10-29T15:03:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c36b97e9430defab4b52ee370c18745343d92f6d'/>
<id>urn:sha1:c36b97e9430defab4b52ee370c18745343d92f6d</id>
<content type='text'>
This patch changes function gfs2_dir_hash_inval so it uses the
i_lock spin_lock to protect the in-core hash table, i_hash_cache.
This will prevent double-frees due to a race between gfs2_evict_inode
and inode invalidation.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
</content>
</entry>
<entry>
<title>VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry-&gt;d_inode) to d_is_*(dentry)</title>
<updated>2015-02-22T16:38:41Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2015-01-29T12:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e36cb0b89ce20b4f8786a57e8a6bc8476f577650'/>
<id>urn:sha1:e36cb0b89ce20b4f8786a57e8a6bc8476f577650</id>
<content type='text'>
Convert the following where appropriate:

 (1) S_ISLNK(dentry-&gt;d_inode) to d_is_symlink(dentry).

 (2) S_ISREG(dentry-&gt;d_inode) to d_is_reg(dentry).

 (3) S_ISDIR(dentry-&gt;d_inode) to d_is_dir(dentry).  This is actually more
     complicated than it appears as some calls should be converted to
     d_can_lookup() instead.  The difference is whether the directory in
     question is a real dir with a -&gt;lookup op or whether it's a fake dir with
     a -&gt;d_automount op.

In some circumstances, we can subsume checks for dentry-&gt;d_inode not being
NULL into this, provided we the code isn't in a filesystem that expects
d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
use d_inode() rather than d_backing_inode() to get the inode pointer).

Note that the dentry type field may be set to something other than
DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
manages the fall-through from a negative dentry to a lower layer.  In such a
case, the dentry type of the negative union dentry is set to the same as the
type of the lower dentry.

However, if you know d_inode is not NULL at the call site, then you can use
the d_is_xxx() functions even in a filesystem.

There is one further complication: a 0,0 chardev dentry may be labelled
DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE.  Strictly, this was
intended for special directory entry types that don't have attached inodes.

The following perl+coccinelle script was used:

use strict;

my @callers;
open($fd, 'git grep -l \'S_IS[A-Z].*-&gt;d_inode\' |') ||
    die "Can't grep for S_ISDIR and co. callers";
@callers = &lt;$fd&gt;;
close($fd);
unless (@callers) {
    print "No matches\n";
    exit(0);
}

my @cocci = (
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISLNK(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_symlink(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISDIR(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_dir(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISREG(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_reg(E)' );

my $coccifile = "tmp.sp.cocci";
open($fd, "&gt;$coccifile") || die $coccifile;
print($fd "$_\n") || die $coccifile foreach (@cocci);
close($fd);

foreach my $file (@callers) {
    chomp $file;
    print "Processing ", $file, "\n";
    system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
	die "spatch failed";
}

[AV: overlayfs parts skipped]

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>GFS2: use __vmalloc GFP_NOFS for fs-related allocations.</title>
<updated>2015-02-04T09:58:41Z</updated>
<author>
<name>Oleg Drokin</name>
</author>
<published>2015-02-02T03:59:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7456a37d55ced3928fd96615fde0dd739985f0dc'/>
<id>urn:sha1:7456a37d55ced3928fd96615fde0dd739985f0dc</id>
<content type='text'>
leaf_dealloc uses vzalloc as a fallback to kzalloc(GFP_NOFS), so
it clearly does not want any shrinker activity within the fs itself.
convert vzalloc into __vmalloc(GFP_NOFS|__GFP_ZERO) to better achieve
this goal.

Signed-off-by: Oleg Drokin &lt;green@linuxhacker.ru&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;

</content>
</entry>
<entry>
<title>GFS2: gfs2_dir_get_hash_table(): avoiding deferred vfree() is easy here...</title>
<updated>2014-11-20T10:29:44Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2014-11-20T05:19:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9265f1d0c7593e3e7e1e94a4a83a6dea34230a35'/>
<id>urn:sha1:9265f1d0c7593e3e7e1e94a4a83a6dea34230a35</id>
<content type='text'>
vfree() is allowed under spinlock these days, but it's cheaper when
it doesn't step into deferred case and here it's very easy to avoid.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;

</content>
</entry>
<entry>
<title>GFS2: use kvfree() instead of open-coding it</title>
<updated>2014-11-20T10:29:14Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2014-11-20T05:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cdcf63ed2d169c82d70a506f3569e484cd9e7a0'/>
<id>urn:sha1:3cdcf63ed2d169c82d70a506f3569e484cd9e7a0</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;

</content>
</entry>
<entry>
<title>GFS2: Make rename not save dirent location</title>
<updated>2014-10-01T13:06:15Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2014-09-29T12:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19aeb5a65f1a6504fc665466c188241e7393d66f'/>
<id>urn:sha1:19aeb5a65f1a6504fc665466c188241e7393d66f</id>
<content type='text'>
This patch fixes a regression in the patch "GFS2: Remember directory
insert point", commit 2b47dad866d04f14c328f888ba5406057b8c7d33.
The problem had to do with the rename function: The function found
space for the new dirent, and remembered that location. But then the
old dirent was removed, which often moved the eligible location for
the renamed dirent. Putting the new dirent at the saved location
caused file system corruption.

This patch adds a new "save_loc" variable to struct gfs2_diradd.
If 1, the dirent location is saved. If 0, the dirent location is not
saved and the buffer_head is released as per previous behavior.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;

</content>
</entry>
<entry>
<title>GFS2: Use pr_&lt;level&gt; more consistently</title>
<updated>2014-03-07T09:30:51Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2014-03-06T20:10:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d77d1b58aaf4456946b8502c67f16b52fda60303'/>
<id>urn:sha1:d77d1b58aaf4456946b8502c67f16b52fda60303</id>
<content type='text'>
Add pr_fmt, remove embedded "GFS2: " prefixes.
This now consistently emits lower case "gfs2: " for each message.

Other miscellanea around these changes:

o Add missing newlines
o Coalesce formats
o Realign arguments

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;

</content>
</entry>
<entry>
<title>GFS2: global conversion to pr_foo()</title>
<updated>2014-03-06T17:34:06Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-03-05T14:06:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc554ed3d89d220b9d0c020e19aa52fb6bf1d673'/>
<id>urn:sha1:fc554ed3d89d220b9d0c020e19aa52fb6bf1d673</id>
<content type='text'>
-All printk(KERN_foo converted to pr_foo().
-Messages updated to fit in 80 columns.
-fs_macros converted as well.
-fs_printk removed.

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
</content>
</entry>
<entry>
<title>GFS2: Add meta readahead field in directory entries</title>
<updated>2014-02-07T11:23:22Z</updated>
<author>
<name>Steven Whitehouse</name>
</author>
<published>2014-02-07T11:23:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=44aaada9d144a46d3de48ad81093f69d17fae96f'/>
<id>urn:sha1:44aaada9d144a46d3de48ad81093f69d17fae96f</id>
<content type='text'>
The intent of this new field in the directory entry is to
allow a subsequent lookup to know how many blocks, which
are contiguous with the inode, contain metadata which relates
to the inode. This will then allow the issuing of a single
read to read these blocks, rather than reading the inode
first, and then issuing a second read for the metadata.

This only works under some fairly strict conditions, since
we do not have back pointers from inodes to directory entries
we must ensure that the blocks referenced in this way will
always belong to the inode.

This rules out being able to use this system for indirect
blocks, as these can change as a result of truncate/rewrite.

So the idea here is to restrict this to xattr blocks only
for the time being. For most inodes, that means only a
single block. Also, when using ACLs and/or SELinux or
other LSMs, these will be added at inode creation time
so that they will be contiguous with the inode on disk and
also will almost always be needed when we read the inode in
for permissions checks.

Once an xattr block for an inode is allocated, it will never
change until the inode is deallocated.

This patch adds the new field, a further patch will add the
readahead in due course.

Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
</content>
</entry>
</feed>
