Skip to contentSkip to conversation

reiser4: porting to 3.16: any reason ->aio_read() of struct file_operations has been left out?

PATCH Ivan Shapovalov 2 participants 10 messages Aug 19, 2014 – Oct 12, 2014

lore
Share & tools
lore
#0 lore raw

From git log I've seen that VFS people intend to replace ->aio_read() and ->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements (however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

What follows is a simple patch that I've currently applied to my own kernel (seems to be the only significant vfs change affecting filesystems), however, I fear that these code-paths are not generally used, so my "works for me" isn't really representative. Could you please clarify the situation here?

From 81172835255a01718c2c256942d5887825a0cd7a Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <[email protected]>
Date: Tue, 19 Aug 2014 14:33:35 +0400
Subject: [PATCH] Adjust reiser4 to 3.16: ->{read,write}_iter of struct
file_operations.

1. ->aio_{read,write} of struct file_operations are being replaced with ->{read,write}_iter.
2. do_sync_{read,write} are being replaced with new_sync_{read,write}.
3. generic_file_splice_write is being replaced with iter_file_splice_write.

---
 fs/reiser4/plugin/file/cryptcompress.c | 2 +-
 fs/reiser4/plugin/file/file.c          | 2 +-
 fs/reiser4/plugin/object.c             | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
fs/reiser4/plugin/file/cryptcompress.c +1 -1
index 8af388d..b0109fb 100644
@@ -2964,7 +2964,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,
 		reiser4_exit_context(ctx);
 		return result;
 	}
-	result = do_sync_read(file, buf, size, off);
+	result = new_sync_read(file, buf, size, off);
 
 	context_set_commit_async(ctx);
 	reiser4_exit_context(ctx);
fs/reiser4/plugin/file/file.c +1 -1
index 94029cd..e65c48d 100644
@@ -1752,7 +1752,7 @@ ssize_t read_unix_file(struct file *file, char __user *buf,
 	switch (uf_info->container) {
 	case UF_CONTAINER_EXTENTS:
 		if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) {
-			result = do_sync_read(file, buf, read_amount, off);
+			result = new_sync_read(file, buf, read_amount, off);
 			break;
 		}
 	case UF_CONTAINER_TAILS:
fs/reiser4/plugin/object.c +2 -2
index 553f1e2..e431e1f 100644
@@ -188,7 +188,7 @@ static struct file_operations regular_file_f_ops = {
 	.llseek = generic_file_llseek,
 	.read = reiser4_read_dispatch,
 	.write = reiser4_write_dispatch,
-	.aio_read = generic_file_aio_read,
+	.read_iter = generic_file_read_iter,
 	.unlocked_ioctl = reiser4_ioctl_dispatch,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = reiser4_ioctl_dispatch,
@@ -198,7 +198,7 @@ static struct file_operations regular_file_f_ops = {
 	.release = reiser4_release_dispatch,
 	.fsync = reiser4_sync_file_common,
 	.splice_read = generic_file_splice_read,
-	.splice_write = generic_file_splice_write
+	.splice_write = iter_file_splice_write
 };
 static struct address_space_operations regular_file_a_ops = {
 	.writepage = reiser4_writepage,
Signature · 5 lines
2.0.4

Thanks,
-- 
Ivan Shapovalov / intelfx /
#1 lore raw
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Quoted 71 lines

What follows is a simple patch that I've currently applied to my own kernel (seems to be the only significant vfs change affecting filesystems), however, I fear that these code-paths are not generally used, so my "works for me" isn't really representative. Could you please clarify the situation here?

From 81172835255a01718c2c256942d5887825a0cd7a Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <[email protected]>
Date: Tue, 19 Aug 2014 14:33:35 +0400
Subject: [PATCH] Adjust reiser4 to 3.16: ->{read,write}_iter of struct
file_operations.

1. ->aio_{read,write} of struct file_operations are being replaced with ->{read,write}_iter.
2. do_sync_{read,write} are being replaced with new_sync_{read,write}.
3. generic_file_splice_write is being replaced with iter_file_splice_write.

---
  fs/reiser4/plugin/file/cryptcompress.c | 2 +-
  fs/reiser4/plugin/file/file.c          | 2 +-
  fs/reiser4/plugin/object.c             | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)
fs/reiser4/plugin/file/cryptcompress.c +1 -1
index 8af388d..b0109fb 100644
@@ -2964,7 +2964,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,
  		reiser4_exit_context(ctx);
  		return result;
  	}
-	result = do_sync_read(file, buf, size, off);
+	result = new_sync_read(file, buf, size, off);
 
  	context_set_commit_async(ctx);
  	reiser4_exit_context(ctx);
fs/reiser4/plugin/file/file.c +1 -1
index 94029cd..e65c48d 100644
@@ -1752,7 +1752,7 @@ ssize_t read_unix_file(struct file *file, char __user *buf,
  	switch (uf_info->container) {
  	case UF_CONTAINER_EXTENTS:
  		if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) {
-			result = do_sync_read(file, buf, read_amount, off);
+			result = new_sync_read(file, buf, read_amount, off);
  			break;
  		}
  	case UF_CONTAINER_TAILS:
fs/reiser4/plugin/object.c +2 -2
index 553f1e2..e431e1f 100644
@@ -188,7 +188,7 @@ static struct file_operations regular_file_f_ops = {
  	.llseek = generic_file_llseek,
  	.read = reiser4_read_dispatch,
  	.write = reiser4_write_dispatch,
-	.aio_read = generic_file_aio_read,
+	.read_iter = generic_file_read_iter,
  	.unlocked_ioctl = reiser4_ioctl_dispatch,
  #ifdef CONFIG_COMPAT
  	.compat_ioctl = reiser4_ioctl_dispatch,
@@ -198,7 +198,7 @@ static struct file_operations regular_file_f_ops = {
  	.release = reiser4_release_dispatch,
  	.fsync = reiser4_sync_file_common,
  	.splice_read = generic_file_splice_read,
-	.splice_write = generic_file_splice_write
+	.splice_write = iter_file_splice_write
  };
  static struct address_space_operations regular_file_a_ops = {
  	.writepage = reiser4_writepage,
#2 lore raw
Quoted 19 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

Quoted 6 lines

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Thanks for explanation! So, does this patch make any sense?

Signature · 1 line
Ivan Shapovalov / intelfx /
Quoted 72 lines
Quoted 71 lines

What follows is a simple patch that I've currently applied to my own kernel (seems to be the only significant vfs change affecting filesystems), however, I fear that these code-paths are not generally used, so my "works for me" isn't really representative. Could you please clarify the situation here?

From 81172835255a01718c2c256942d5887825a0cd7a Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <[email protected]>
Date: Tue, 19 Aug 2014 14:33:35 +0400
Subject: [PATCH] Adjust reiser4 to 3.16: ->{read,write}_iter of struct
file_operations.

1. ->aio_{read,write} of struct file_operations are being replaced with ->{read,write}_iter.
2. do_sync_{read,write} are being replaced with new_sync_{read,write}.
3. generic_file_splice_write is being replaced with iter_file_splice_write.

---
  fs/reiser4/plugin/file/cryptcompress.c | 2 +-
  fs/reiser4/plugin/file/file.c          | 2 +-
  fs/reiser4/plugin/object.c             | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)
fs/reiser4/plugin/file/cryptcompress.c +1 -1
index 8af388d..b0109fb 100644
@@ -2964,7 +2964,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,
  		reiser4_exit_context(ctx);
  		return result;
  	}
-	result = do_sync_read(file, buf, size, off);
+	result = new_sync_read(file, buf, size, off);
 
  	context_set_commit_async(ctx);
  	reiser4_exit_context(ctx);
fs/reiser4/plugin/file/file.c +1 -1
index 94029cd..e65c48d 100644
@@ -1752,7 +1752,7 @@ ssize_t read_unix_file(struct file *file, char __user *buf,
  	switch (uf_info->container) {
  	case UF_CONTAINER_EXTENTS:
  		if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) {
-			result = do_sync_read(file, buf, read_amount, off);
+			result = new_sync_read(file, buf, read_amount, off);
  			break;
  		}
  	case UF_CONTAINER_TAILS:
fs/reiser4/plugin/object.c +2 -2
index 553f1e2..e431e1f 100644
@@ -188,7 +188,7 @@ static struct file_operations regular_file_f_ops = {
  	.llseek = generic_file_llseek,
  	.read = reiser4_read_dispatch,
  	.write = reiser4_write_dispatch,
-	.aio_read = generic_file_aio_read,
+	.read_iter = generic_file_read_iter,
  	.unlocked_ioctl = reiser4_ioctl_dispatch,
  #ifdef CONFIG_COMPAT
  	.compat_ioctl = reiser4_ioctl_dispatch,
@@ -198,7 +198,7 @@ static struct file_operations regular_file_f_ops = {
  	.release = reiser4_release_dispatch,
  	.fsync = reiser4_sync_file_common,
  	.splice_read = generic_file_splice_read,
-	.splice_write = generic_file_splice_write
+	.splice_write = iter_file_splice_write
  };
  static struct address_space_operations regular_file_a_ops = {
  	.writepage = reiser4_writepage,
#3 lore raw
Quoted 18 lines · Ivan Shapovalov
Quoted 17 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

Quoted 8 lines
Quoted 6 lines

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

#4 lore raw
Quoted 27 lines · Edward Shishkin
Quoted 25 lines · Ivan Shapovalov
Quoted 23 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Quoted 7 lines
Quoted 1 line

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

Could you please comment on this? :)

Thanks,

Signature · 1 line
Ivan Shapovalov / intelfx /
#5 lore raw
Quoted 34 lines · Ivan Shapovalov
Quoted 23 lines · Edward Shishkin
Quoted 22 lines · Ivan Shapovalov
Quoted 21 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

Edward.

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

Quoted 8 lines

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

Could you please comment on this? :)

I'll try to take a look at weekends..

Thanks,
Edward.

#6 lore raw
In reply to Ivan Shapovalov
Quoted 24 lines · Ivan Shapovalov
Quoted 23 lines · Edward Shishkin
Quoted 22 lines · Ivan Shapovalov
Quoted 21 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 1 line

Edward.

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

I have looked at VFS changes 3.15->3.16.

generic_file_aio_read() was replaced with generic_file_read_iter() Respectively, all its users (including us) now call ->read_iter().

Since we don't implement our own ->aio_read(), we should use new_sync_read() instead of do_sync_read().

So, everything looks OK with our read/write.

Quoted 11 lines

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

Could you please comment on this? :)

generic_file_splice_write() did:

->write_begin()
memcpy();
->write_end()

iter_file_splice_write() with generic_file_write_iter() does:

->write_begin()
copy_from_user();
->write_end()

So the question is why copy_from_user() works instead of memcpy()? TBH, I don't know. If interesting, ask VFS folks and tell us then ;)

Thanks,
Edward.

#7 lore raw
In reply to Ivan Shapovalov
Quoted 15 lines · Ivan Shapovalov
Quoted 14 lines · Edward Shishkin
Quoted 13 lines · Ivan Shapovalov
Quoted 12 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread).

This mailing thread sheds the light on why we don't want to use generic write:
(this in only FYI, don't try to make friendship between reiser4 and VFS :))

http://markmail.org/message/ydzplf6bxokfgkch#query:+page:1+mid:appoj72tdeop3f7f+state:results

Quoted 24 lines
Quoted 11 lines
Quoted 6 lines
Quoted 5 lines

CRYPTCOMPRESS doesn't
use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

Could you please comment on this? :)

Thanks,

#8 lore raw
In reply to Ivan Shapovalov
Quoted 39 lines · Ivan Shapovalov
Quoted 27 lines · Edward Shishkin
Quoted 25 lines · Ivan Shapovalov
Quoted 23 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Edward.

Quoted 7 lines
Quoted 1 line

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

Quoted 6 lines

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

...aand... it doesn't. At least on reg40 (sic, NOT ccreg40):
1) kde-cp and FF 32.0.3's downloader produce empty files;
2) some applications (at least two games: luftrausers and x-plane 10, both proprietary) deadlock somewhere inside of generic_file_write_iter().

Removing ".splice_write = iter_file_splice_write" and ".write_iter = generic_file_write_iter" fixes the described cases.

Unfortunately, no time to dig deeper (MIPT is evil). Hopefully you will look into it someday... :)

Thanks,

Signature · 1 line
Ivan Shapovalov / intelfx /
#9 lore raw
Quoted 41 lines · Ivan Shapovalov
Quoted 34 lines · Ivan Shapovalov
Quoted 23 lines · Edward Shishkin
Quoted 22 lines · Ivan Shapovalov
Quoted 21 lines · Edward Shishkin
Quoted 11 lines · Ivan Shapovalov

From git log I've seen that VFS people intend to replace ->aio_read() and
->aio_write() of struct file_operations with new methods ->read_iter() and ->write_iter().

(Along with a couple of related new helpers, differing from previous just in calling _iter methods instead of aio_ ones.)

From other filesystems it seems that these are simple drop-in replacements
(however, well, I have zero familiarity with VFS). So here is a question:
is there any intentional reason that generic_file_aio_write() is not used in reiser4?

Currently reiser4 is a set of two filesystems which differ in methods of handling regular files. For VFS we provide "dispatchers", which pass management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).

UNIX_FILE plugin doesn't use generic write for performance reasons (I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't use it for compatibility reasons: I don't know how how to rewrite it gracefully using the generic write method.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

Edward.

Thanks for explanation! So, does this patch make any sense?

I haven't looked at this carefully yet, but likely it is correct.

Thanks,
Edward.

Turned out it isn't.. The iter_file_splice_write() requires ->write_iter to be set, or a NULL dereference happens.

Quoted 6 lines

At first I've thought that we're out of luck and will need to use the fallback splice implementation (default_file_splice_write), but just setting ->write_iter to generic_file_write_iter strangely worked.

(By "it works" I mean "splice finishes successfully and does not cause data corruptions").

Quoted 7 lines

...aand... it doesn't. At least on reg40 (sic, NOT ccreg40):
1) kde-cp and FF 32.0.3's downloader produce empty files;
2) some applications (at least two games: luftrausers and x-plane 10, both proprietary) deadlock somewhere inside of generic_file_write_iter().

Removing ".splice_write = iter_file_splice_write" and ".write_iter = generic_file_write_iter" fixes the described cases.

Thanks for the observation,
so the final port will look like this (attached)

Quoted 3 lines

Unfortunately, no time to dig deeper (MIPT is evil). Hopefully you will look into it someday... :)

Yup, sure, study is the first deal.

Thanks,
Edward.

Only in linux-3.15/fs/reiser4/: context.h~

fs/reiser4/plugin/file/cryptcompress.c +1 -1
diff -u -r linux-3.15/fs/reiser4/plugin/file/cryptcompress.c linux-3.16.1/fs/reiser4/plugin/file/cryptcompress.c
@@ -2964,7 +2964,7 @@
 		reiser4_exit_context(ctx);
 		return result;
 	}
-	result = do_sync_read(file, buf, size, off);
+	result = new_sync_read(file, buf, size, off);
 
 	context_set_commit_async(ctx);
 	reiser4_exit_context(ctx);
fs/reiser4/plugin/file/file.c +1 -1
diff -u -r linux-3.15/fs/reiser4/plugin/file/file.c linux-3.16.1/fs/reiser4/plugin/file/file.c
@@ -1752,7 +1752,7 @@
 	switch (uf_info->container) {
 	case UF_CONTAINER_EXTENTS:
 		if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) {
-			result = do_sync_read(file, buf, read_amount, off);
+			result = new_sync_read(file, buf, read_amount, off);
 			break;
 		}
 	case UF_CONTAINER_TAILS:
fs/reiser4/plugin/object.c +1 -2
diff -u -r linux-3.15/fs/reiser4/plugin/object.c linux-3.16.1/fs/reiser4/plugin/object.c
@@ -127,7 +127,7 @@
 	.llseek = generic_file_llseek,
 	.read = reiser4_read_dispatch,
 	.write = reiser4_write_dispatch,
-	.aio_read = generic_file_aio_read,
+	.read_iter = generic_file_read_iter,
 	.unlocked_ioctl = reiser4_ioctl_dispatch,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = reiser4_ioctl_dispatch,
@@ -137,7 +138,6 @@
 	.release = reiser4_release_dispatch,
 	.fsync = reiser4_sync_file_common,
 	.splice_read = generic_file_splice_read,
-	.splice_write = generic_file_splice_write
 };
 static struct address_space_operations regular_file_a_ops = {
 	.writepage = reiser4_writepage,