All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
@ 2015-11-11 11:57 Stefan Priebe - Profihost AG
  2015-11-11 12:22 ` Holger Hoffstätte
  2015-11-12 10:21 ` David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Priebe - Profihost AG @ 2015-11-11 11:57 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs

Hi,

the patch btrfs: properly set the termination value of ctx->pos in
readdir introduces a regression to me.

A lot of stuff runs in "endless" or long running loops.

An example strace looks like this:
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0g8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0g8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0h8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0h8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0i8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0i8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0j8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0j8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0k8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0k8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0l8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0l8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0m8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0m8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0n8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0n8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0o8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0o8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0p8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0p8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0q8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0q8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0r8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0r8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
newfstatat(AT_FDCWD, "changelog", {st_mode=S_IFREG|0644, st_size=148,
...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0s8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0s8\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...}, 56,
0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
{st_mode=S_IFREG|0644, st_size=148, ...}, AT_SYMLINK_NOFOLLOW) = 0
semop(98307, {{0, -1, SEM_UNDO}}, 1)    = 0
msgsnd(0, {1,
"\3\0\0\0\247\r\0\0\2358\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...},
56, 0) = 0
msgrcv(32769, {1,
"\3\0\0\0\247\r\0\0\2358\0\0\0\0\0\0\0\0\0\0\345<\1\0\0\0\0\0\35\0\0\0"...},
56, 0, 0) = 56
semop(98307, {{0, 1, SEM_UNDO}}, 1)     = 0
^C <unfinished ...>
Process 3495 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 36.28    0.076892          10      7717           semop
 24.25    0.051399          13      3858           newfstatat
 21.48    0.045530          12      3858           msgsnd
 17.46    0.036994          10      3859           msgrcv
  0.52    0.001110          24        46           write
------ ----------- ----------- --------- --------- ----------------
100.00    0.211925                 19338           total

Stefan

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

* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
  2015-11-11 11:57 Regression in btrfs: properly set the termination value of ctx->pos in readdir Stefan Priebe - Profihost AG
@ 2015-11-11 12:22 ` Holger Hoffstätte
  2015-11-12 10:35   ` David Sterba
  2015-11-12 10:21 ` David Sterba
  1 sibling, 1 reply; 6+ messages in thread
From: Holger Hoffstätte @ 2015-11-11 12:22 UTC (permalink / raw)
  To: Stefan Priebe - Profihost AG; +Cc: dsterba, linux-btrfs

On Wed, Nov 11, 2015 at 12:57 PM, Stefan Priebe - Profihost AG
<s.priebe@profihost.ag> wrote:
> Hi,
>
> the patch btrfs: properly set the termination value of ctx->pos in
> readdir introduces a regression to me.
>
> A lot of stuff runs in "endless" or long running loops.

Just tested this and can confirm something is off.
In a directory with several files, create a new directory and move all
files into the new subdir.
An immediately following ls will hang. The problem goes away after a
manual sync.

-h

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

* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
  2015-11-11 11:57 Regression in btrfs: properly set the termination value of ctx->pos in readdir Stefan Priebe - Profihost AG
  2015-11-11 12:22 ` Holger Hoffstätte
@ 2015-11-12 10:21 ` David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: David Sterba @ 2015-11-12 10:21 UTC (permalink / raw)
  To: Stefan Priebe - Profihost AG; +Cc: dsterba, linux-btrfs

On Wed, Nov 11, 2015 at 12:57:30PM +0100, Stefan Priebe - Profihost AG wrote:
> the patch btrfs: properly set the termination value of ctx->pos in
> readdir introduces a regression to me.
> 
> A lot of stuff runs in "endless" or long running loops.

This might be related to the readdir fix but I don't see it anywhere in
the strace log. There don't seem to be any connection (fd, other
structures) to the syscalls in the strace log. I'll investigate further.

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

* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
  2015-11-11 12:22 ` Holger Hoffstätte
@ 2015-11-12 10:35   ` David Sterba
  2015-11-12 13:09     ` David Sterba
  0 siblings, 1 reply; 6+ messages in thread
From: David Sterba @ 2015-11-12 10:35 UTC (permalink / raw)
  To: Holger Hoffstätte; +Cc: Stefan Priebe - Profihost AG, dsterba, linux-btrfs

On Wed, Nov 11, 2015 at 01:22:19PM +0100, Holger Hoffstätte wrote:
> > the patch btrfs: properly set the termination value of ctx->pos in
> > readdir introduces a regression to me.
> >
> > A lot of stuff runs in "endless" or long running loops.
> 
> Just tested this and can confirm something is off.
> In a directory with several files, create a new directory and move all
> files into the new subdir.
> 
> An immediately following ls will hang. The problem goes away after a
> manual sync.

I can reproduce the hang, thanks.

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

* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
  2015-11-12 10:35   ` David Sterba
@ 2015-11-12 13:09     ` David Sterba
  2015-11-12 13:17       ` Holger Hoffstätte
  0 siblings, 1 reply; 6+ messages in thread
From: David Sterba @ 2015-11-12 13:09 UTC (permalink / raw)
  To: Holger Hoffstätte, Stefan Priebe - Profihost AG, linux-btrfs

On Thu, Nov 12, 2015 at 11:35:23AM +0100, David Sterba wrote:
> On Wed, Nov 11, 2015 at 01:22:19PM +0100, Holger Hoffstätte wrote:
> > > the patch btrfs: properly set the termination value of ctx->pos in
> > > readdir introduces a regression to me.
> > >
> > > A lot of stuff runs in "endless" or long running loops.
> > 
> > Just tested this and can confirm something is off.
> > In a directory with several files, create a new directory and move all
> > files into the new subdir.
> > 
> > An immediately following ls will hang. The problem goes away after a
> > manual sync.
> 
> I can reproduce the hang, thanks.

The hang was triggered by use of trace_printk and I'm seeing several
strange bugs caused by added debugging, so I can't say I can reproduce
it yet.

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

* Re: Regression in btrfs: properly set the termination value of ctx->pos in readdir
  2015-11-12 13:09     ` David Sterba
@ 2015-11-12 13:17       ` Holger Hoffstätte
  0 siblings, 0 replies; 6+ messages in thread
From: Holger Hoffstätte @ 2015-11-12 13:17 UTC (permalink / raw)
  To: dsterba, Stefan Priebe - Profihost AG, linux-btrfs

On 11/12/15 14:09, David Sterba wrote:
> On Thu, Nov 12, 2015 at 11:35:23AM +0100, David Sterba wrote:
>> On Wed, Nov 11, 2015 at 01:22:19PM +0100, Holger Hoffstätte wrote:
>>>> the patch btrfs: properly set the termination value of ctx->pos in
>>>> readdir introduces a regression to me.
>>>>
>>>> A lot of stuff runs in "endless" or long running loops.
>>>
>>> Just tested this and can confirm something is off.
>>> In a directory with several files, create a new directory and move all
>>> files into the new subdir.
>>>
>>> An immediately following ls will hang. The problem goes away after a
>>> manual sync.
>>
>> I can reproduce the hang, thanks.
> 
> The hang was triggered by use of trace_printk and I'm seeing several
> strange bugs caused by added debugging, so I can't say I can reproduce
> it yet.

Be that as it may, the procedure I described above immediately started to
work again when I backed out this patch. I also didn't noctice anything
wrong before Stefan's email, so it's apparently not easy to hit.

-h


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

end of thread, other threads:[~2015-11-12 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 11:57 Regression in btrfs: properly set the termination value of ctx->pos in readdir Stefan Priebe - Profihost AG
2015-11-11 12:22 ` Holger Hoffstätte
2015-11-12 10:35   ` David Sterba
2015-11-12 13:09     ` David Sterba
2015-11-12 13:17       ` Holger Hoffstätte
2015-11-12 10:21 ` 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.