* BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze
@ 2016-02-16 15:38 Colin Ian King
2016-02-16 15:51 ` Filipe Manana
0 siblings, 1 reply; 5+ messages in thread
From: Colin Ian King @ 2016-02-16 15:38 UTC (permalink / raw)
To: linux-btrfs
Hi there,
bug: https://bugzilla.kernel.org/show_bug.cgi?id=101951 and also
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532145
Commit 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 ("overlayfs: Make f_path
always point to the overlay and f_inode to the underlay") resulted in an
issue when using a combination of btrfs and overlayfs. This is
noticeable when doing a fsync() on a file in a chroot with overlayfs on
top of btrfs; we hit a kernel oops in btrfs_sync_file() on
atomic_inc(&root->log_batch) because root is NULL.
I've debugged this further and found that in btrfs_sync_file():
struct inode *inode = d_inode(dentry);
does not return the inode I expected when using the stacked overlay fs,
where as:
struct inode *inode = file_inode(file);
does.
However, I'm not well at all well versed in btrfs, so I am not confident
this is a actually correct. Any comments?
Colin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze
2016-02-16 15:38 BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze Colin Ian King
@ 2016-02-16 15:51 ` Filipe Manana
2016-02-16 16:08 ` Colin Ian King
0 siblings, 1 reply; 5+ messages in thread
From: Filipe Manana @ 2016-02-16 15:51 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-btrfs@vger.kernel.org
On Tue, Feb 16, 2016 at 3:38 PM, Colin Ian King
<colin.king@canonical.com> wrote:
> Hi there,
>
> bug: https://bugzilla.kernel.org/show_bug.cgi?id=101951 and also
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532145
>
> Commit 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 ("overlayfs: Make f_path
> always point to the overlay and f_inode to the underlay") resulted in an
> issue when using a combination of btrfs and overlayfs. This is
> noticeable when doing a fsync() on a file in a chroot with overlayfs on
> top of btrfs; we hit a kernel oops in btrfs_sync_file() on
> atomic_inc(&root->log_batch) because root is NULL.
>
> I've debugged this further and found that in btrfs_sync_file():
>
> struct inode *inode = d_inode(dentry);
>
> does not return the inode I expected when using the stacked overlay fs,
> where as:
>
> struct inode *inode = file_inode(file);
>
> does.
See the discussion at
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg48131.html
You can get along with file_inode() in btrfs_sync_file(), but not
later the fsync code path where we traverse the hierarchy up using
dentries.
More details on that thread.
>
> However, I'm not well at all well versed in btrfs, so I am not confident
> this is a actually correct. Any comments?
>
> Colin
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze
2016-02-16 15:51 ` Filipe Manana
@ 2016-02-16 16:08 ` Colin Ian King
2016-02-16 16:11 ` Filipe Manana
0 siblings, 1 reply; 5+ messages in thread
From: Colin Ian King @ 2016-02-16 16:08 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs@vger.kernel.org
On 16/02/16 15:51, Filipe Manana wrote:
> On Tue, Feb 16, 2016 at 3:38 PM, Colin Ian King
> <colin.king@canonical.com> wrote:
>> Hi there,
>>
>> bug: https://bugzilla.kernel.org/show_bug.cgi?id=101951 and also
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532145
>>
>> Commit 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 ("overlayfs: Make f_path
>> always point to the overlay and f_inode to the underlay") resulted in an
>> issue when using a combination of btrfs and overlayfs. This is
>> noticeable when doing a fsync() on a file in a chroot with overlayfs on
>> top of btrfs; we hit a kernel oops in btrfs_sync_file() on
>> atomic_inc(&root->log_batch) because root is NULL.
>>
>> I've debugged this further and found that in btrfs_sync_file():
>>
>> struct inode *inode = d_inode(dentry);
>>
>> does not return the inode I expected when using the stacked overlay fs,
>> where as:
>>
>> struct inode *inode = file_inode(file);
>>
>> does.
>
> See the discussion at
> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg48131.html
>
> You can get along with file_inode() in btrfs_sync_file(), but not
> later the fsync code path where we traverse the hierarchy up using
> dentries.
> More details on that thread.
Ah, good. So was there any resolution on a way forward for a fix?
>
>>
>> However, I'm not well at all well versed in btrfs, so I am not confident
>> this is a actually correct. Any comments?
>>
>> Colin
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze
2016-02-16 16:08 ` Colin Ian King
@ 2016-02-16 16:11 ` Filipe Manana
2016-02-16 16:17 ` Colin Ian King
0 siblings, 1 reply; 5+ messages in thread
From: Filipe Manana @ 2016-02-16 16:11 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-btrfs@vger.kernel.org
On Tue, Feb 16, 2016 at 4:08 PM, Colin Ian King
<colin.king@canonical.com> wrote:
> On 16/02/16 15:51, Filipe Manana wrote:
>> On Tue, Feb 16, 2016 at 3:38 PM, Colin Ian King
>> <colin.king@canonical.com> wrote:
>>> Hi there,
>>>
>>> bug: https://bugzilla.kernel.org/show_bug.cgi?id=101951 and also
>>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532145
>>>
>>> Commit 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 ("overlayfs: Make f_path
>>> always point to the overlay and f_inode to the underlay") resulted in an
>>> issue when using a combination of btrfs and overlayfs. This is
>>> noticeable when doing a fsync() on a file in a chroot with overlayfs on
>>> top of btrfs; we hit a kernel oops in btrfs_sync_file() on
>>> atomic_inc(&root->log_batch) because root is NULL.
>>>
>>> I've debugged this further and found that in btrfs_sync_file():
>>>
>>> struct inode *inode = d_inode(dentry);
>>>
>>> does not return the inode I expected when using the stacked overlay fs,
>>> where as:
>>>
>>> struct inode *inode = file_inode(file);
>>>
>>> does.
>>
>> See the discussion at
>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg48131.html
>>
>> You can get along with file_inode() in btrfs_sync_file(), but not
>> later the fsync code path where we traverse the hierarchy up using
>> dentries.
>> More details on that thread.
>
> Ah, good. So was there any resolution on a way forward for a fix?
Nop.
>
>>
>>>
>>> However, I'm not well at all well versed in btrfs, so I am not confident
>>> this is a actually correct. Any comments?
>>>
>>> Colin
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze
2016-02-16 16:11 ` Filipe Manana
@ 2016-02-16 16:17 ` Colin Ian King
0 siblings, 0 replies; 5+ messages in thread
From: Colin Ian King @ 2016-02-16 16:17 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs@vger.kernel.org
On 16/02/16 16:11, Filipe Manana wrote:
> On Tue, Feb 16, 2016 at 4:08 PM, Colin Ian King
> <colin.king@canonical.com> wrote:
>> On 16/02/16 15:51, Filipe Manana wrote:
>>> On Tue, Feb 16, 2016 at 3:38 PM, Colin Ian King
>>> <colin.king@canonical.com> wrote:
>>>> Hi there,
>>>>
>>>> bug: https://bugzilla.kernel.org/show_bug.cgi?id=101951 and also
>>>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532145
>>>>
>>>> Commit 4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01 ("overlayfs: Make f_path
>>>> always point to the overlay and f_inode to the underlay") resulted in an
>>>> issue when using a combination of btrfs and overlayfs. This is
>>>> noticeable when doing a fsync() on a file in a chroot with overlayfs on
>>>> top of btrfs; we hit a kernel oops in btrfs_sync_file() on
>>>> atomic_inc(&root->log_batch) because root is NULL.
>>>>
>>>> I've debugged this further and found that in btrfs_sync_file():
>>>>
>>>> struct inode *inode = d_inode(dentry);
>>>>
>>>> does not return the inode I expected when using the stacked overlay fs,
>>>> where as:
>>>>
>>>> struct inode *inode = file_inode(file);
>>>>
>>>> does.
>>>
>>> See the discussion at
>>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg48131.html
>>>
>>> You can get along with file_inode() in btrfs_sync_file(), but not
>>> later the fsync code path where we traverse the hierarchy up using
>>> dentries.
>>> More details on that thread.
>>
>> Ah, good. So was there any resolution on a way forward for a fix?
>
> Nop.
>
OK, so chroots don't work, that's a bit of a show stopper :-/
>>
>>>
>>>>
>>>> However, I'm not well at all well versed in btrfs, so I am not confident
>>>> this is a actually correct. Any comments?
>>>>
>>>> Colin
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>>
>>>
>>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-02-16 16:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 15:38 BZ#101951, Overlayfs on top of btrfs causes kernel oops + freeze Colin Ian King
2016-02-16 15:51 ` Filipe Manana
2016-02-16 16:08 ` Colin Ian King
2016-02-16 16:11 ` Filipe Manana
2016-02-16 16:17 ` Colin Ian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).