<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/util.c, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-10-10T06:56:04Z</updated>
<entry>
<title>ovl: fix memory leak on unlink of indexed file</title>
<updated>2018-10-10T06:56:04Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-09-18T13:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c7949a5f63769c6d3a3b41326b7b0a2a43777af'/>
<id>urn:sha1:1c7949a5f63769c6d3a3b41326b7b0a2a43777af</id>
<content type='text'>
commit 63e132528032ce937126aba591a7b37ec593a6bb upstream.

The memory leak was detected by kmemleak when running xfstests
overlay/051,053

Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries")
Cc: &lt;stable@vger.kernel.org&gt; # v4.13
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: constant st_ino for non-samefs with xino</title>
<updated>2018-04-12T10:04:50Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-11-07T11:55:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e487d889b7e3e8ec4091eb83bc4f7e67c7f05e27'/>
<id>urn:sha1:e487d889b7e3e8ec4091eb83bc4f7e67c7f05e27</id>
<content type='text'>
On 64bit systems, when overlay layers are not all on the same fs, but
all inode numbers of underlying fs are not using the high bits, use the
high bits to partition the overlay st_ino address space.  The high bits
hold the fsid (upper fsid is 0).  This way overlay inode numbers are unique
and all inodes use overlay st_dev.  Inode numbers are also persistent
for a given layer configuration.

Currently, our only indication for available high ino bits is from a
filesystem that supports file handles and uses the default encode_fh()
operation, which encodes a 32bit inode number.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: allocate anon bdev per unique lower fs</title>
<updated>2018-04-12T10:04:50Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-03-28T17:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5148626b806a74dd219f2bce5f204abf909f6930'/>
<id>urn:sha1:5148626b806a74dd219f2bce5f204abf909f6930</id>
<content type='text'>
Instead of allocating an anonymous bdev per lower layer, allocate
one anonymous bdev per every unique lower fs that is different than
upper fs.

Every unique lower fs is assigned an fsid &gt; 0 and the number of
unique lower fs are stored in ofs-&gt;numlowerfs.

The assigned fsid is stored in the lower layer struct and will be
used also for inode number multiplexing.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: factor out ovl_map_dev_ino() helper</title>
<updated>2018-04-12T10:04:50Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-11-08T17:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da309e8c055de8d6461ae01764a3352c77878735'/>
<id>urn:sha1:da309e8c055de8d6461ae01764a3352c77878735</id>
<content type='text'>
A helper for ovl_getattr() to map the values of st_dev and st_ino
according to constant st_ino rules.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: set i_ino to the value of st_ino for NFS export</title>
<updated>2018-04-12T10:04:48Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-03-15T21:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=695b46e76b62447e506cddc87e088236498008e5'/>
<id>urn:sha1:695b46e76b62447e506cddc87e088236498008e5</id>
<content type='text'>
Eddie Horng reported that readdir of an overlayfs directory that
was exported via NFSv3 returns entries with d_type set to DT_UNKNOWN.
The reason is that while preparing the response for readdirplus, nfsd
checks inside encode_entryplus_baggage() that a child dentry's inode
number matches the value of d_ino returns by overlayfs readdir iterator.

Because the overlayfs inodes use arbitrary inode numbers that are not
correlated with the values of st_ino/d_ino, NFSv3 falls back to not
encoding d_type. Although this is an allowed behavior, we can fix it for
the case of all overlayfs layers on the same underlying filesystem.

When NFS export is enabled and d_ino is consistent with st_ino
(samefs), set the same value also to i_ino in ovl_fill_inode() for all
overlayfs inodes, nfsd readdirplus sanity checks will pass.
ovl_fill_inode() may be called from ovl_new_inode(), before real inode
was created with ino arg 0. In that case, i_ino will be updated to real
upper inode i_ino on ovl_inode_init() or ovl_inode_update().

Reported-by: Eddie Horng &lt;eddiehorng.tw@gmail.com&gt;
Tested-by: Eddie Horng &lt;eddiehorng.tw@gmail.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Fixes: 8383f1748829 ("ovl: wire up NFS export operations")
Cc: &lt;stable@vger.kernel.org&gt; #v4.16
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: store 'has_upper' and 'opaque' as bit flags</title>
<updated>2018-01-24T10:25:58Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-01-14T17:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c62520a83bceae0bb0b7b3de10c3e81205cd3823'/>
<id>urn:sha1:c62520a83bceae0bb0b7b3de10c3e81205cd3823</id>
<content type='text'>
We need to make some room in struct ovl_entry to store information
about redirected ancestors for NFS export, so cram two booleans as
bit flags.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: copy up of disconnected dentries</title>
<updated>2018-01-24T10:25:58Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-10-15T15:00:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa3ff3c152ff94ef045ed802db7535167f8a21ab'/>
<id>urn:sha1:aa3ff3c152ff94ef045ed802db7535167f8a21ab</id>
<content type='text'>
With NFS export, some operations on decoded file handles (e.g. open,
link, setattr, xattr_set) may call copy up with a disconnected non-dir.
In this case, we will copy up lower inode to index dir without
linking it to upper dir.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: whiteout index when union nlink drops to zero</title>
<updated>2018-01-24T10:25:56Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-10-24T14:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7dd0e71348c1e3bc4b9d767c1ffbcbdee46a726'/>
<id>urn:sha1:e7dd0e71348c1e3bc4b9d767c1ffbcbdee46a726</id>
<content type='text'>
With NFS export feature enabled, when overlay inode nlink drops to
zero, instead of removing the index entry, replace it with a whiteout
index entry.

This is needed for NFS export in order to prevent future open by handle
from opening the lower file directly.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: cleanup dir index when dir nlink drops to zero</title>
<updated>2018-01-24T10:25:55Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-09-26T04:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89a17556ce4d113f6e7896e118a14f79a84484e9'/>
<id>urn:sha1:89a17556ce4d113f6e7896e118a14f79a84484e9</id>
<content type='text'>
When non-dir index union nlink drops to zero the non-dir index
is cleaned. Do the same for directory type index entries when
union directory is removed.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: index directories on copy up for NFS export</title>
<updated>2018-01-24T10:25:55Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-01-11T12:01:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=016b720f5558d825bc0a4c6d2bdd6929fbe86536'/>
<id>urn:sha1:016b720f5558d825bc0a4c6d2bdd6929fbe86536</id>
<content type='text'>
With the NFS export feature enabled, all dirs are indexed on copy up.
Non-dir files are copied up directly to indexdir and then hardlinked
to upper dir.

Directories are copied up to indexdir, then an index entry is created
in indexdir with 'upper' xattr pointing to the copied up dir and then
the copied up dir is moved to upper dir.

Directory index is also used for consistency verification, like
detecting multiple redirected dirs to the same lower dir on lookup.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
