<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/fs/orangefs/orangefs-kernel.h, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/fs/orangefs/orangefs-kernel.h?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/fs/orangefs/orangefs-kernel.h?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-04-08T13:38:51Z</updated>
<entry>
<title>orangefs: get rid of knob code...</title>
<updated>2020-04-08T13:38:51Z</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2020-04-08T12:52:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ec95f1dedc9c64ac5a8b0bdb7c276936c70fdedd'/>
<id>urn:sha1:ec95f1dedc9c64ac5a8b0bdb7c276936c70fdedd</id>
<content type='text'>
Christoph Hellwig sent in a reversion of "orangefs: remember count
when reading." because:

  -&gt;read_iter calls can race with each other and one or
  more -&gt;flush calls. Remove the the scheme to store the read
  count in the file private data as is is completely racy and
  can cause use after free or double free conditions

Christoph's reversion caused Orangefs not to work or to compile. I
added a patch that fixed that, but intel's kbuild test robot pointed
out that sending Christoph's patch followed by my patch upstream, it
would break bisection because of the failure to compile. So I have
combined the reversion plus my patch... here's the commit message
that was in my patch:

  Logically, optimal Orangefs "pages" are 4 megabytes. Reading
  large Orangefs files 4096 bytes at a time is like trying to
  kick a dead whale down the beach. Before Christoph's "Revert
  orangefs: remember count when reading." I tried to give users
  a knob whereby they could, for example, use "count" in
  read(2) or bs with dd(1) to get whatever they considered an
  appropriate amount of bytes at a time from Orangefs and fill
  as many page cache pages as they could at once.

  Without the racy code that Christoph reverted Orangefs won't
  even compile, much less work. So this replaces the logic that
  used the private file data that Christoph reverted with
  a static number of bytes to read from Orangefs.

  I ran tests like the following to determine what a
  reasonable static number of bytes might be:

  dd if=/pvfsmnt/asdf of=/dev/null count=128 bs=4194304
  dd if=/pvfsmnt/asdf of=/dev/null count=256 bs=2097152
  dd if=/pvfsmnt/asdf of=/dev/null count=512 bs=1048576
                            .
                            .
                            .
  dd if=/pvfsmnt/asdf of=/dev/null count=4194304 bs=128

  Reads seem faster using the static number, so my "knob code"
  wasn't just racy, it wasn't even a good idea...

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
</content>
</entry>
<entry>
<title>orangefs: posix open permission checking...</title>
<updated>2019-12-04T13:52:55Z</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2019-11-26T17:39:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f9bbb68233aa5bd5ef238bd3532fddf92fa1b53c'/>
<id>urn:sha1:f9bbb68233aa5bd5ef238bd3532fddf92fa1b53c</id>
<content type='text'>
Orangefs has no open, and orangefs checks file permissions
on each file access. Posix requires that file permissions
be checked on open and nowhere else. Orangefs-through-the-kernel
needs to seem posix compliant.

The VFS opens files, even if the filesystem provides no
method. We can see if a file was successfully opened for
read and or for write by looking at file-&gt;f_mode.

When writes are flowing from the page cache, file is no
longer available. We can trust the VFS to have checked
file-&gt;f_mode before writing to the page cache.

The mode of a file might change between when it is opened
and IO commences, or it might be created with an arbitrary mode.

We'll make sure we don't hit EACCES during the IO stage by
using UID 0. Some of the time we have access without changing
to UID 0 - how to check?

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>docs: fs: convert porting to ReST</title>
<updated>2019-07-31T19:31:10Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-07-26T12:51:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=25b532cec59ee119bf1c4081fe06fac43722f61f'/>
<id>urn:sha1:25b532cec59ee119bf1c4081fe06fac43722f61f</id>
<content type='text'>
This file has its own proper style, except that, after a while,
the coding style gets violated and whitespaces are placed on
different ways.

As Sphinx and ReST are very sentitive to whitespace differences,
I had to opt if each entry after required/mandatory/... fields
should start with zero spaces or with a tab. I opted to start them
all from the zero position, in order to avoid needing to break lines
with more than 80 columns, with would make harder for review.

Most of the other changes at porting.rst were made to use an unified
notation with works nice as a text file while also produce a good html
output after being parsed.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>orangefs: pass slot index back to readpage.</title>
<updated>2019-05-03T18:32:39Z</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2019-03-25T22:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=4077a0f25b001926f86d35f6236351583bada9a4'/>
<id>urn:sha1:4077a0f25b001926f86d35f6236351583bada9a4</id>
<content type='text'>
When userspace deposits more than a page of data into the shared buffer,
we'll need to know which slot it is in when we get back to readpage
so that we can try to use the extra data to fill some extra pages.

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: remember count when reading.</title>
<updated>2019-05-03T18:32:39Z</updated>
<author>
<name>Mike Marshall</name>
<email>hubcap@omnibond.com</email>
</author>
<published>2019-03-25T19:52:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c2549f8c7a28c00facaf911f700c4811cfd6f52b'/>
<id>urn:sha1:c2549f8c7a28c00facaf911f700c4811cfd6f52b</id>
<content type='text'>
Orangefs wins when it can do IO on large (up to four meg) blocks at a time,
and looses when it has to do tiny "small io" reads and writes. Accessing
Orangefs through the pagecache with the kernel module helps with small io,
both reading and writing, a great deal. Readpage generally tries to fetch a
page (four k) at a time. We'll let users use "count" (as in read(2) or
pread(2) for example) as a knob to control how much data they get from
Orangefs at a time and we'll try to use the data to fill extra
pagecache pages when we get to -&gt;readpage, hopefully resulting in
fewer calls to readpage and Orangefs userspace.

We need a way to remember how they set count so that we can still have
it available when we get to -&gt;readpage.

 - We'll use file-&gt;private_data to keep track of "count".
   We'll wrap generic_file_open with orangefs_file_open and
   initialize private_data to NULL there.

 - In -&gt;read_iter we have access to both "count" and file, so
   we'll kmalloc some space onto file-&gt;private_data and store
   "count" there.

 - We'll kfree file-&gt;private_data each time we visit -&gt;flush and
   reinitialize it to NULL.

Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: add orangefs_revalidate_mapping</title>
<updated>2019-05-03T18:32:39Z</updated>
<author>
<name>Martin Brandenburg</name>
<email>martin@omnibond.com</email>
</author>
<published>2019-02-12T20:19:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8f04e1be784858ba0288c7c09b9de06627a800c9'/>
<id>urn:sha1:8f04e1be784858ba0288c7c09b9de06627a800c9</id>
<content type='text'>
This is modeled after NFS, except our method is different.  We use a
simple timer to determine whether to invalidate the page cache.  This
is bound to perform.

This addes a sysfs parameter cache_timeout_msecs which controls the time
between page cache invalidations.

Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: write range tracking</title>
<updated>2019-05-03T18:32:38Z</updated>
<author>
<name>Martin Brandenburg</name>
<email>martin@omnibond.com</email>
</author>
<published>2018-12-14T20:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=52e2d0a3804c095775b178d6b0707ef6ac8e6d04'/>
<id>urn:sha1:52e2d0a3804c095775b178d6b0707ef6ac8e6d04</id>
<content type='text'>
Attach the actual range of bytes written to plus the responsible uid/gid
to each dirty page.  This information must be sent to the server when
the page is written out.

Now write_begin, page_mkwrite, and invalidatepage keep up with this
information.  There are several conditions where they must write out the
page immediately to store the new range.  Two non-contiguous ranges
cannot be stored on a single page.

Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: migrate to generic_file_read_iter</title>
<updated>2019-05-03T18:32:38Z</updated>
<author>
<name>Martin Brandenburg</name>
<email>martin@omnibond.com</email>
</author>
<published>2018-02-16T20:51:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c453dcfc79815760071bd9a7805d4b809fec05cf'/>
<id>urn:sha1:c453dcfc79815760071bd9a7805d4b809fec05cf</id>
<content type='text'>
Remove orangefs_inode_read.  It was used by readpage.  Calling
wait_for_direct_io directly serves the purpose just as well.  There is
now no check of the bufmap size in the readpage path.  There are already
other places the bufmap size is assumed to be greater than PAGE_SIZE.

Important to call truncate_inode_pages now in the write path so a
subsequent read sees the new data.

Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: service ops done for writeback are not killable</title>
<updated>2019-05-03T18:32:38Z</updated>
<author>
<name>Martin Brandenburg</name>
<email>martin@omnibond.com</email>
</author>
<published>2018-02-15T19:38:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=0dcac0f7812b2c09ed018a5eba91448a37f1b71b'/>
<id>urn:sha1:0dcac0f7812b2c09ed018a5eba91448a37f1b71b</id>
<content type='text'>
Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
<entry>
<title>orangefs: reorganize setattr functions to track attribute changes</title>
<updated>2019-05-03T18:32:38Z</updated>
<author>
<name>Martin Brandenburg</name>
<email>martin@omnibond.com</email>
</author>
<published>2018-02-13T20:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=afd9fb2a31797b4c787034294a4062df0c19c37e'/>
<id>urn:sha1:afd9fb2a31797b4c787034294a4062df0c19c37e</id>
<content type='text'>
OrangeFS accepts a mask indicating which attributes were changed.  The
kernel must not set any bits except those that were actually changed.
The kernel must set the uid/gid of the request to the actual uid/gid
responsible for the change.

Code path for notify_change initiated setattrs is

orangefs_setattr(dentry, iattr)
-&gt; __orangefs_setattr(inode, iattr)

In kernel changes are initiated by calling __orangefs_setattr.

Code path for writeback is

orangefs_write_inode
-&gt; orangefs_inode_setattr

attr_valid and attr_uid and attr_gid change together under i_lock.
I_DIRTY changes separately.

__orangefs_setattr
	lock
	if needs to be cleaned first, unlock and retry
	set attr_valid
	copy data in
	unlock
	mark_inode_dirty

orangefs_inode_setattr
	lock
	copy attributes out
	unlock
	clear getattr_time
	# __writeback_single_inode clears dirty

orangefs_inode_getattr
	# possible to get here with attr_valid set and not dirty
	lock
	if getattr_time ok or attr_valid set, unlock and return
	unlock
	do server operation
	# another thread may getattr or setattr, so check for that
	lock
	if getattr_time ok or attr_valid, unlock and return
	else, copy in
	update getattr_time
	unlock

Signed-off-by: Martin Brandenburg &lt;martin@omnibond.com&gt;
Signed-off-by: Mike Marshall &lt;hubcap@omnibond.com&gt;
</content>
</entry>
</feed>
