All of lore.kernel.org
 help / color / mirror / Atom feed
* Commit edf064e7c (btrfs: nowait aio support) breaks shells
@ 2017-07-04  4:23 Markus Trippelsdorf
  2017-07-04  7:45 ` Markus Trippelsdorf
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Trippelsdorf @ 2017-07-04  4:23 UTC (permalink / raw)
  To: linux-block, linux-kernel, linux-btrfs
  Cc: David Sterba, Goldwyn Rodrigues, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad)
Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
Date:   Tue Jun 20 07:05:49 2017 -0500

    btrfs: nowait aio support

apparently breaks several shell related features on my system.
In zsh history stopped working, because no new entries are added
anymore.
I fist noticed the issue when I tried to build mplayer. It uses a shell
script to generate a help_mp.h file:

  % help/help_create.sh help/help_mp-en.h UTF-8

This file gets corrupted:

--- help_mp_good.h      2017-07-04 05:38:33.161640826 +0200
+++ help_mp_bad.h       2017-07-04 05:51:00.650730726 +0200
@@ -1,14 +1,8 @@
-/* WARNING! This is a generated file, do NOT edit.
- * See the help/ subdirectory for the editable files. */
 
 -#ifndef MPLAYER_HELP_MP_H
 -#define MPLAYER_HELP_MP_H
 -
 -#include <inttypes.h>
 -#include "config.h"
 +#endif /* MPLAYER_HELP_MP_H */
 +he English master file */
  
  -// $Revision: 37846 $
  -// MASTER FILE. Use this file as base for translations.
  + for translations.
...
(I have attached the testcase.)

/dev/sdc3 on / type btrfs (rw,noatime,lazytime,compress=lzo,ssd,noacl,space_cache=v2,subvolid=5,subvol=/) 
 # cat /sys/block/sdc/queue/scheduler
[none] mq-deadline 

-- 
Markus

[-- Attachment #2: test.tar.bz2 --]
[-- Type: application/octet-stream, Size: 31795 bytes --]

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-04  4:23 Commit edf064e7c (btrfs: nowait aio support) breaks shells Markus Trippelsdorf
@ 2017-07-04  7:45 ` Markus Trippelsdorf
  2017-07-04 15:31   ` Goldwyn Rodrigues
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Trippelsdorf @ 2017-07-04  7:45 UTC (permalink / raw)
  To: linux-block, linux-kernel, linux-btrfs
  Cc: David Sterba, Goldwyn Rodrigues, Jens Axboe

On 2017.07.04 at 06:23 +0200, Markus Trippelsdorf wrote:
> commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad)
> Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
> Date:   Tue Jun 20 07:05:49 2017 -0500
> 
>     btrfs: nowait aio support
> 
> apparently breaks several shell related features on my system.

Here is a simple testcase:

 % echo "foo" >> test
 % echo "foo" >> test
 % cat test
 foo
 %

-- 
Markus

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-04  7:45 ` Markus Trippelsdorf
@ 2017-07-04 15:31   ` Goldwyn Rodrigues
  2017-07-04 15:37     ` Markus Trippelsdorf
  2017-07-04 22:16     ` Jens Axboe
  0 siblings, 2 replies; 8+ messages in thread
From: Goldwyn Rodrigues @ 2017-07-04 15:31 UTC (permalink / raw)
  To: Markus Trippelsdorf, linux-block, linux-kernel, linux-btrfs
  Cc: David Sterba, Jens Axboe



On 07/04/2017 02:45 AM, Markus Trippelsdorf wrote:
> On 2017.07.04 at 06:23 +0200, Markus Trippelsdorf wrote:
>> commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad)
>> Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
>> Date:   Tue Jun 20 07:05:49 2017 -0500
>>
>>     btrfs: nowait aio support
>>
>> apparently breaks several shell related features on my system.
> 
> Here is a simple testcase:
> 
>  % echo "foo" >> test
>  % echo "foo" >> test
>  % cat test
>  foo
>  %
> 

Thanks for testing.
Yes, pos must be set with iocb->ki_pos for appends. I should not have
removed the initialization. Could you try this patch?

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 59e2dccdf75b..7947781229e5 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1931,6 +1931,7 @@ static ssize_t btrfs_file_write_iter(struct kiocb
*iocb,
 	 */
 	update_time_for_write(inode);

+	pos = iocb->ki_pos;
 	start_pos = round_down(pos, fs_info->sectorsize);
 	oldsize = i_size_read(inode);
 	if (start_pos > oldsize) {



-- 
Goldwyn

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-04 15:31   ` Goldwyn Rodrigues
@ 2017-07-04 15:37     ` Markus Trippelsdorf
  2017-07-04 22:16     ` Jens Axboe
  1 sibling, 0 replies; 8+ messages in thread
From: Markus Trippelsdorf @ 2017-07-04 15:37 UTC (permalink / raw)
  To: Goldwyn Rodrigues
  Cc: linux-block, linux-kernel, linux-btrfs, David Sterba, Jens Axboe

On 2017.07.04 at 10:31 -0500, Goldwyn Rodrigues wrote:
> 
> 
> On 07/04/2017 02:45 AM, Markus Trippelsdorf wrote:
> > On 2017.07.04 at 06:23 +0200, Markus Trippelsdorf wrote:
> >> commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad)
> >> Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
> >> Date:   Tue Jun 20 07:05:49 2017 -0500
> >>
> >>     btrfs: nowait aio support
> >>
> >> apparently breaks several shell related features on my system.
> > 
> > Here is a simple testcase:
> > 
> >  % echo "foo" >> test
> >  % echo "foo" >> test
> >  % cat test
> >  foo
> >  %
> > 
> 
> Thanks for testing.
> Yes, pos must be set with iocb->ki_pos for appends. I should not have
> removed the initialization. Could you try this patch?

It fixes the issue. Thank you.

-- 
Markus

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-04 15:31   ` Goldwyn Rodrigues
  2017-07-04 15:37     ` Markus Trippelsdorf
@ 2017-07-04 22:16     ` Jens Axboe
  2017-07-08  1:51       ` Goldwyn Rodrigues
  1 sibling, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2017-07-04 22:16 UTC (permalink / raw)
  To: Goldwyn Rodrigues, Markus Trippelsdorf, linux-block,
	linux-kernel, linux-btrfs
  Cc: David Sterba

On 07/04/2017 09:31 AM, Goldwyn Rodrigues wrote:
> 
> 
> On 07/04/2017 02:45 AM, Markus Trippelsdorf wrote:
>> On 2017.07.04 at 06:23 +0200, Markus Trippelsdorf wrote:
>>> commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad)
>>> Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
>>> Date:   Tue Jun 20 07:05:49 2017 -0500
>>>
>>>     btrfs: nowait aio support
>>>
>>> apparently breaks several shell related features on my system.
>>
>> Here is a simple testcase:
>>
>>  % echo "foo" >> test
>>  % echo "foo" >> test
>>  % cat test
>>  foo
>>  %
>>
> 
> Thanks for testing.
> Yes, pos must be set with iocb->ki_pos for appends. I should not have
> removed the initialization. Could you try this patch?
> 
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index 59e2dccdf75b..7947781229e5 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -1931,6 +1931,7 @@ static ssize_t btrfs_file_write_iter(struct kiocb
> *iocb,
>  	 */
>  	update_time_for_write(inode);
> 
> +	pos = iocb->ki_pos;
>  	start_pos = round_down(pos, fs_info->sectorsize);
>  	oldsize = i_size_read(inode);
>  	if (start_pos > oldsize) {

Please expedite getting this upstream, asap.

-- 
Jens Axboe

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-04 22:16     ` Jens Axboe
@ 2017-07-08  1:51       ` Goldwyn Rodrigues
  2017-07-08  2:09         ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Goldwyn Rodrigues @ 2017-07-08  1:51 UTC (permalink / raw)
  To: Jens Axboe, Markus Trippelsdorf, linux-block, linux-kernel, linux-btrfs
  Cc: David Sterba



On 07/04/2017 05:16 PM, Jens Axboe wrote:
> 
> Please expedite getting this upstream, asap.
> 

Jens,

I have posted an updated patch [1] and it is acked by David. Would you
pick it up or should it go through the btrfs tree (or some other tree)?

[1] https://patchwork.kernel.org/patch/9825813/

-- 
Goldwyn

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-08  1:51       ` Goldwyn Rodrigues
@ 2017-07-08  2:09         ` Jens Axboe
  2017-07-10 12:33           ` David Sterba
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2017-07-08  2:09 UTC (permalink / raw)
  To: Goldwyn Rodrigues, Markus Trippelsdorf, linux-block,
	linux-kernel, linux-btrfs
  Cc: David Sterba

On 07/07/2017 07:51 PM, Goldwyn Rodrigues wrote:
> 
> 
> On 07/04/2017 05:16 PM, Jens Axboe wrote:
>>
>> Please expedite getting this upstream, asap.
>>
> 
> Jens,
> 
> I have posted an updated patch [1] and it is acked by David. Would you
> pick it up or should it go through the btrfs tree (or some other tree)?
> 
> [1] https://patchwork.kernel.org/patch/9825813/

I'm fine with either, I just want it to go in asap. I'm sending off
a pull Monday. David, up to you.

-- 
Jens Axboe

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

* Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells
  2017-07-08  2:09         ` Jens Axboe
@ 2017-07-10 12:33           ` David Sterba
  0 siblings, 0 replies; 8+ messages in thread
From: David Sterba @ 2017-07-10 12:33 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Goldwyn Rodrigues, Markus Trippelsdorf, linux-block, linux-btrfs,
	linux-kernel

On Fri, Jul 07, 2017 at 08:09:28PM -0600, Jens Axboe wrote:
> On 07/07/2017 07:51 PM, Goldwyn Rodrigues wrote:
> > On 07/04/2017 05:16 PM, Jens Axboe wrote:
> >>
> >> Please expedite getting this upstream, asap.
> > 
> > I have posted an updated patch [1] and it is acked by David. Would you
> > pick it up or should it go through the btrfs tree (or some other tree)?
> > 
> > [1] https://patchwork.kernel.org/patch/9825813/
> 
> I'm fine with either, I just want it to go in asap. I'm sending off
> a pull Monday. David, up to you.

I'm reading this just now, so I'll send the patch in my pull today.

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

end of thread, other threads:[~2017-07-10 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04  4:23 Commit edf064e7c (btrfs: nowait aio support) breaks shells Markus Trippelsdorf
2017-07-04  7:45 ` Markus Trippelsdorf
2017-07-04 15:31   ` Goldwyn Rodrigues
2017-07-04 15:37     ` Markus Trippelsdorf
2017-07-04 22:16     ` Jens Axboe
2017-07-08  1:51       ` Goldwyn Rodrigues
2017-07-08  2:09         ` Jens Axboe
2017-07-10 12:33           ` David Sterba

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.