All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reiser4: remove an assertion "nikita-2577" which is no longer possible to check.
@ 2014-05-05 23:59 Ivan Shapovalov
  2014-05-06  7:22 ` Edward Shishkin
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Shapovalov @ 2014-05-05 23:59 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: Ivan Shapovalov

Since 3.11, file->f_pos is not up-to-date during an iterate() in progress. This
was true for readdir(), but is no longer so.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---

Is this correct? I assume that adjust_dir_pos() is called simultaneously with
iterate()... or not? If not, then passing 'dir->f_pos' to reiser4_get_dir_fpos()
will suffice.

 fs/reiser4/plugin/file_ops_readdir.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/reiser4/plugin/file_ops_readdir.c b/fs/reiser4/plugin/file_ops_readdir.c
index 0da5ac5..f53573c 100644
--- a/fs/reiser4/plugin/file_ops_readdir.c
+++ b/fs/reiser4/plugin/file_ops_readdir.c
@@ -58,8 +58,6 @@ adjust_dir_pos(struct file *dir, struct readdir_pos *readdir_spot,
 		/* logical number of directory entry readdir is "looking" at
 		 * changes */
 		readdir_spot->entry_no += adj;
-		assert("nikita-2577",
-		       ergo(dir != NULL, reiser4_get_dir_fpos(dir) + adj >= 0));
 		if (de_id_cmp(&pos->dir_entry_key,
 			      &mod_point->dir_entry_key) == EQUAL_TO) {
 			assert("nikita-2575", mod_point->pos < pos->pos);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] reiser4: remove an assertion "nikita-2577" which is no longer possible to check.
  2014-05-05 23:59 [PATCH] reiser4: remove an assertion "nikita-2577" which is no longer possible to check Ivan Shapovalov
@ 2014-05-06  7:22 ` Edward Shishkin
  2014-05-06 11:18   ` [PATCHv2] reiser4: fix an assertion broken since 3.11 Ivan Shapovalov
  0 siblings, 1 reply; 3+ messages in thread
From: Edward Shishkin @ 2014-05-06  7:22 UTC (permalink / raw)
  To: Ivan Shapovalov; +Cc: reiserfs-devel

On 05/06/2014 01:59 AM, Ivan Shapovalov wrote:
> Since 3.11, file->f_pos is not up-to-date during an iterate() in progress. This
> was true for readdir(), but is no longer so.
>
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
>
> Is this correct? I assume that adjust_dir_pos() is called simultaneously with
> iterate()... or not?

adjust_dir_pos() is a work around seekdir/telldir API, and has nothing
with iterate(), see the comment before  reiser4_iterate_common().
So, I think, it is incorrect, and dir->f_pos is perfectly valid.

>   If not, then passing 'dir->f_pos' to reiser4_get_dir_fpos()
> will suffice.
>
>   fs/reiser4/plugin/file_ops_readdir.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/fs/reiser4/plugin/file_ops_readdir.c b/fs/reiser4/plugin/file_ops_readdir.c
> index 0da5ac5..f53573c 100644
> --- a/fs/reiser4/plugin/file_ops_readdir.c
> +++ b/fs/reiser4/plugin/file_ops_readdir.c
> @@ -58,8 +58,6 @@ adjust_dir_pos(struct file *dir, struct readdir_pos *readdir_spot,
>   		/* logical number of directory entry readdir is "looking" at
>   		 * changes */
>   		readdir_spot->entry_no += adj;
> -		assert("nikita-2577",
> -		       ergo(dir != NULL, reiser4_get_dir_fpos(dir) + adj >= 0));
>   		if (de_id_cmp(&pos->dir_entry_key,
>   			      &mod_point->dir_entry_key) == EQUAL_TO) {
>   			assert("nikita-2575", mod_point->pos < pos->pos);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2] reiser4: fix an assertion broken since 3.11.
  2014-05-06  7:22 ` Edward Shishkin
@ 2014-05-06 11:18   ` Ivan Shapovalov
  0 siblings, 0 replies; 3+ messages in thread
From: Ivan Shapovalov @ 2014-05-06 11:18 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: edward.shishkin, Ivan Shapovalov

reiser4_get_dir_fpos takes an extra argument. It should be safe to pass
dir->f_pos (thus keeping the old behavior exactly).

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---

OK, got it.

 fs/reiser4/plugin/file_ops_readdir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/reiser4/plugin/file_ops_readdir.c b/fs/reiser4/plugin/file_ops_readdir.c
index 0da5ac5..e359dec 100644
--- a/fs/reiser4/plugin/file_ops_readdir.c
+++ b/fs/reiser4/plugin/file_ops_readdir.c
@@ -59,7 +59,8 @@ adjust_dir_pos(struct file *dir, struct readdir_pos *readdir_spot,
 		 * changes */
 		readdir_spot->entry_no += adj;
 		assert("nikita-2577",
-		       ergo(dir != NULL, reiser4_get_dir_fpos(dir) + adj >= 0));
+		       ergo(dir != NULL, reiser4_get_dir_fpos(dir, dir->f_pos) + adj
+		                         >= 0));
 		if (de_id_cmp(&pos->dir_entry_key,
 			      &mod_point->dir_entry_key) == EQUAL_TO) {
 			assert("nikita-2575", mod_point->pos < pos->pos);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-06 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-05 23:59 [PATCH] reiser4: remove an assertion "nikita-2577" which is no longer possible to check Ivan Shapovalov
2014-05-06  7:22 ` Edward Shishkin
2014-05-06 11:18   ` [PATCHv2] reiser4: fix an assertion broken since 3.11 Ivan Shapovalov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.