Re: [logfs] BUG: unable to handle kernel NULL pointer dereference at (null)

2014-03-23 Thread Prasad Joshi
On Sun, Mar 23, 2014 at 12:35 PM, Fengguang Wu  wrote:
> Hi Joshi,
>
> FYI, this commit seems to trigger the logfs bug earlier.
>
> commit 98e7a989979b185f49e86ddaed2ad6890299d9f0
> Author: Yinghai Lu 
> AuthorDate: Wed Mar 6 20:18:21 2013 -0800
> Commit: H. Peter Anvin 
> CommitDate: Wed Mar 6 20:18:32 2013 -0800
>
> x86, mm: Make sure to find a 2M free block for the first mapped area
> [snip]
> Reported-by: Henrik Rydberg 
> Bisected-by: Henrik Rydberg 
> Tested-by: Henrik Rydberg 
> Signed-off-by: Yinghai Lu 
> Link: 
> http://lkml.kernel.org/r/cae9fiqx4nq7_1kg5rl_vh56rmcshxui1exrzx7cwed4ngmn...@mail.gmail.com
> Signed-off-by: H. Peter Anvin 
>
> ===
> PARENT COMMIT NOT CLEAN. LOOK OUT FOR WRONG BISECT!
> ===
>
> +-+++---+
> | 
> | 015221fefb | 98e7a98997 | next-20140321 |
> +-+++---+
> | boot_successes  
> | 35 | 6  | 7 |
> | boot_failures   
> | 73 | 21 | 12|
> | BUG:unable_to_handle_kernel_paging_request  
> | 73 ||   |
> | Oops
> | 73 | 21 | 12|
> | RIP:perf_swevent_init   
> | 9  ||   |
> | BUG:sleeping_function_called_from_invalid_context_at_kernel/rwsem.c 
> | 9  | 21 |   |
> | backtrace:perf_swevent_init 
> | 9  ||   |
> | backtrace:perf_init_event   
> | 9  ||   |
> | backtrace:async_page_fault  
> | 9  ||   |
> | RIP:__alloc_memory_core_early   
> | 64 ||   |
> | Kernel_panic-not_syncing:Attempted_to_kill_the_idle_task
> | 64 ||   |
> | backtrace:__alloc_bootmem   
> | 64 ||   |
> | backtrace:sparse_init   
> | 64 ||   |
> | backtrace:paging_init   
> | 64 ||   |
> | BUG:unable_to_handle_kernel_NULL_pointer_dereference
> | 0  | 21 | 12|
> | RIP:__mutex_lock_slowpath   
> | 0  | 21 | 12|
> | BUG:scheduling_while_atomic 
> | 0  | 21 |   |
> | BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c
> | 0  | 6  |   |
> | BUG:sleeping_function_called_from_invalid_context_at_kernel/locking/rwsem.c 
> | 0  | 0  | 12|
> | backtrace:do_mount  
> | 0  | 0  | 12|
> | backtrace:SyS_mount 
> | 0  | 0  | 12|
> +-+++---+
>

Thanks a lot for BUG report and your analysis and sorry for delayed response.

> [0.931658] LogFS: Start unmounting
> [0.932279] LogFS: Start mount 1

Does this happen first time you try to mount LogFS?
If yes can you please recreate the file system (mklogfs). To recreate
the file system please clone the latest logfsprogs from
https://github.com/prasad-joshi/logfsprogs.git

If this does not help, can you please email me steps for reproducing
the problem on my setup?

Thanks and Regards,
Prasad

> [0.932857] LogFS: Start unmounting
> [0.933482] BUG: unable to handle kernel NULL pointer dereference at   
> (null)
> [0.934337] IP: [] __mutex_lock_slowpath+0x4b/0xc2
> [0.934337] PGD 11e41067 P

Re: [logfs] BUG: unable to handle kernel NULL pointer dereference at (null)

2014-03-23 Thread Prasad Joshi
On Sun, Mar 23, 2014 at 12:35 PM, Fengguang Wu fengguang...@intel.com wrote:
 Hi Joshi,

 FYI, this commit seems to trigger the logfs bug earlier.

 commit 98e7a989979b185f49e86ddaed2ad6890299d9f0
 Author: Yinghai Lu ying...@kernel.org
 AuthorDate: Wed Mar 6 20:18:21 2013 -0800
 Commit: H. Peter Anvin h...@zytor.com
 CommitDate: Wed Mar 6 20:18:32 2013 -0800

 x86, mm: Make sure to find a 2M free block for the first mapped area
 [snip]
 Reported-by: Henrik Rydberg rydb...@euromail.se
 Bisected-by: Henrik Rydberg rydb...@euromail.se
 Tested-by: Henrik Rydberg rydb...@euromail.se
 Signed-off-by: Yinghai Lu ying...@kernel.org
 Link: 
 http://lkml.kernel.org/r/cae9fiqx4nq7_1kg5rl_vh56rmcshxui1exrzx7cwed4ngmn...@mail.gmail.com
 Signed-off-by: H. Peter Anvin h...@zytor.com

 ===
 PARENT COMMIT NOT CLEAN. LOOK OUT FOR WRONG BISECT!
 ===

 +-+++---+
 | 
 | 015221fefb | 98e7a98997 | next-20140321 |
 +-+++---+
 | boot_successes  
 | 35 | 6  | 7 |
 | boot_failures   
 | 73 | 21 | 12|
 | BUG:unable_to_handle_kernel_paging_request  
 | 73 ||   |
 | Oops
 | 73 | 21 | 12|
 | RIP:perf_swevent_init   
 | 9  ||   |
 | BUG:sleeping_function_called_from_invalid_context_at_kernel/rwsem.c 
 | 9  | 21 |   |
 | backtrace:perf_swevent_init 
 | 9  ||   |
 | backtrace:perf_init_event   
 | 9  ||   |
 | backtrace:async_page_fault  
 | 9  ||   |
 | RIP:__alloc_memory_core_early   
 | 64 ||   |
 | Kernel_panic-not_syncing:Attempted_to_kill_the_idle_task
 | 64 ||   |
 | backtrace:__alloc_bootmem   
 | 64 ||   |
 | backtrace:sparse_init   
 | 64 ||   |
 | backtrace:paging_init   
 | 64 ||   |
 | BUG:unable_to_handle_kernel_NULL_pointer_dereference
 | 0  | 21 | 12|
 | RIP:__mutex_lock_slowpath   
 | 0  | 21 | 12|
 | BUG:scheduling_while_atomic 
 | 0  | 21 |   |
 | BUG:sleeping_function_called_from_invalid_context_at_mm/memory.c
 | 0  | 6  |   |
 | BUG:sleeping_function_called_from_invalid_context_at_kernel/locking/rwsem.c 
 | 0  | 0  | 12|
 | backtrace:do_mount  
 | 0  | 0  | 12|
 | backtrace:SyS_mount 
 | 0  | 0  | 12|
 +-+++---+


Thanks a lot for BUG report and your analysis and sorry for delayed response.

 [0.931658] LogFS: Start unmounting
 [0.932279] LogFS: Start mount 1

Does this happen first time you try to mount LogFS?
If yes can you please recreate the file system (mklogfs). To recreate
the file system please clone the latest logfsprogs from
https://github.com/prasad-joshi/logfsprogs.git

If this does not help, can you please email me steps for reproducing
the problem on my setup?

Thanks and Regards,
Prasad

 [0.932857] LogFS: Start unmounting
 [0.933482] BUG: unable to handle kernel NULL pointer dereference at   
 (null)
 [0.934337] IP: [8149797f] __mutex_lock_slowpath+0x4b/0xc2
 [0.934337] PGD 11e41067 PUD 1183f067 PMD 0
 [0.934337] Oops: 0002 [#1]
 [0.934337] Modules linked in:
 [0.934337] CPU: 0 PID: 498 Comm: mount Not tainted 
 3.14.0-rc7-next

[PATCH] sysctl: Use BUG_ON instead of BUG

2012-09-02 Thread Prasad Joshi
The use of if (!head) BUG(); can be replaced with single line
BUG_ON(!head).

Signed-off-by: Prasad Joshi 
---
 fs/proc/proc_sysctl.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index dfafeb2..63bdfa0 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -266,8 +266,7 @@ void sysctl_head_put(struct ctl_table_header *head)
 
 static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
 {
-   if (!head)
-   BUG();
+   BUG_ON(!head);
spin_lock(_lock);
if (!use_table(head))
head = ERR_PTR(-ENOENT);
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sysctl: Use BUG_ON instead of BUG

2012-09-02 Thread Prasad Joshi
The use of if (!head) BUG(); can be replaced with single line
BUG_ON(!head).

Signed-off-by: Prasad Joshi prasadjoshi.li...@gmail.com
---
 fs/proc/proc_sysctl.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index dfafeb2..63bdfa0 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -266,8 +266,7 @@ void sysctl_head_put(struct ctl_table_header *head)
 
 static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
 {
-   if (!head)
-   BUG();
+   BUG_ON(!head);
spin_lock(sysctl_lock);
if (!use_table(head))
head = ERR_PTR(-ENOENT);
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ASoC: correct the check for NULL dma_buffer pointer

2012-08-30 Thread Prasad Joshi
The if condition
if (!buf && !buf->area)

checks if the buf pointer is NULL and then dereferences it again to
check if the buffer area is NULL, resulting in possible NULL
dereference.

Signed-off-by: Prasad Joshi 
---
 sound/soc/spear/spear_pcm.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 97c2cac..8c7f237 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm)
continue;
 
buf = >dma_buffer;
-   if (!buf && !buf->area)
+   if (!buf || !buf->area)
continue;
 
dma_free_writecombine(pcm->card->dev, buf->bytes,
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ASoC: correct the check for NULL dma_buffer pointer

2012-08-30 Thread Prasad Joshi
The if condition
if (!buf  !buf-area)

checks if the buf pointer is NULL and then dereferences it again to
check if the buffer area is NULL, resulting in possible NULL
dereference.

Signed-off-by: Prasad Joshi prasadjoshi.li...@gmail.com
---
 sound/soc/spear/spear_pcm.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 97c2cac..8c7f237 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm)
continue;
 
buf = substream-dma_buffer;
-   if (!buf  !buf-area)
+   if (!buf || !buf-area)
continue;
 
dma_free_writecombine(pcm-card-dev, buf-bytes,
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] logfs: some important bug fixes

2012-08-26 Thread Prasad Joshi
On Sun, Aug 26, 2012 at 4:56 PM, Prasad Joshi
 wrote:
> Hello Linus,
>
> Could you please pull the following changes since commit
> dd775ae2549217d3ae09363e3edb305d0fa19928:
>
>   Linux 3.4-rc1 (2012-03-31 16:24:09 -0700)
>
> are available in the git repository at:
>   git://github.com/prasad-joshi/logfs_upstream.git master
>
> Prasad Joshi (5):
>   logfs: destroy the reserved inodes while unmounting
>   logfs: initialize the number of iovecs in bio
>   logfs: create a pagecache page if it is not present
>   logfs: maintain the ordering of meta-inode destruction
>   logfs: query block device for number of pages to send with bio
>

Please pardon my ignorance, here is a short description of above patches

9f0bbd8 logfs: query block device for number of pages to send with bio
This BUG was found when LogFS was used on KVM. The patch fixes
the problem by asking for underlaying block device the number
of pages to send with each BIO.

41b93bc logfs: maintain the ordering of meta-inode destruction
LogFS maintains file system meta-data in special inodes. These
inodes are releated to each other, therefore they must be
destroyed in a proper order.

ddb24bb logfs: create a pagecache page if it is not present

cd8bfa9 logfs: initialize the number of iovecs in bio
LogFS used to panic when it was created on an encrypted LVM
volume. The patch fixes the problem by properly initializing
the BIO.

d2dcd90 logfs: destroy the reserved inodes while unmounting

Sorry for multiple mails and inconvenience it might have caused.

Thanks and Regards,
Prasad

>  fs/logfs/dev_bdev.c  |   15 +++
>  fs/logfs/inode.c |   18 +-
>  fs/logfs/journal.c   |2 +-
>  fs/logfs/readwrite.c |1 -
>  fs/logfs/segment.c   |2 +-
>  5 files changed, 26 insertions(+), 12 deletions(-)
>
> Please note that the signed tag (for-linus) is applied and the same is
> pushed. The repository is also added in the 'linux-next' and there no
> conflicts in the 'linux-next: Tree for Aug 24'.
>
> Thanks and Warm Regards,
> Prasad
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] logfs: some important bug fixes

2012-08-26 Thread Prasad Joshi
Hello Linus,

Could you please pull the following changes since commit
dd775ae2549217d3ae09363e3edb305d0fa19928:

  Linux 3.4-rc1 (2012-03-31 16:24:09 -0700)

are available in the git repository at:
  git://github.com/prasad-joshi/logfs_upstream.git master

Prasad Joshi (5):
  logfs: destroy the reserved inodes while unmounting
  logfs: initialize the number of iovecs in bio
  logfs: create a pagecache page if it is not present
  logfs: maintain the ordering of meta-inode destruction
  logfs: query block device for number of pages to send with bio

 fs/logfs/dev_bdev.c  |   15 +++
 fs/logfs/inode.c |   18 +-
 fs/logfs/journal.c   |2 +-
 fs/logfs/readwrite.c |1 -
 fs/logfs/segment.c   |2 +-
 5 files changed, 26 insertions(+), 12 deletions(-)

Please note that the signed tag (for-linus) is applied and the same is
pushed. The repository is also added in the 'linux-next' and there no
conflicts in the 'linux-next: Tree for Aug 24'.

Thanks and Warm Regards,
Prasad
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] logfs: some important bug fixes

2012-08-26 Thread Prasad Joshi
Hello Linus,

Could you please pull the following changes since commit
dd775ae2549217d3ae09363e3edb305d0fa19928:

  Linux 3.4-rc1 (2012-03-31 16:24:09 -0700)

are available in the git repository at:
  git://github.com/prasad-joshi/logfs_upstream.git master

Prasad Joshi (5):
  logfs: destroy the reserved inodes while unmounting
  logfs: initialize the number of iovecs in bio
  logfs: create a pagecache page if it is not present
  logfs: maintain the ordering of meta-inode destruction
  logfs: query block device for number of pages to send with bio

 fs/logfs/dev_bdev.c  |   15 +++
 fs/logfs/inode.c |   18 +-
 fs/logfs/journal.c   |2 +-
 fs/logfs/readwrite.c |1 -
 fs/logfs/segment.c   |2 +-
 5 files changed, 26 insertions(+), 12 deletions(-)

Please note that the signed tag (for-linus) is applied and the same is
pushed. The repository is also added in the 'linux-next' and there no
conflicts in the 'linux-next: Tree for Aug 24'.

Thanks and Warm Regards,
Prasad
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] logfs: some important bug fixes

2012-08-26 Thread Prasad Joshi
On Sun, Aug 26, 2012 at 4:56 PM, Prasad Joshi
prasadjoshi.li...@gmail.com wrote:
 Hello Linus,

 Could you please pull the following changes since commit
 dd775ae2549217d3ae09363e3edb305d0fa19928:

   Linux 3.4-rc1 (2012-03-31 16:24:09 -0700)

 are available in the git repository at:
   git://github.com/prasad-joshi/logfs_upstream.git master

 Prasad Joshi (5):
   logfs: destroy the reserved inodes while unmounting
   logfs: initialize the number of iovecs in bio
   logfs: create a pagecache page if it is not present
   logfs: maintain the ordering of meta-inode destruction
   logfs: query block device for number of pages to send with bio


Please pardon my ignorance, here is a short description of above patches

9f0bbd8 logfs: query block device for number of pages to send with bio
This BUG was found when LogFS was used on KVM. The patch fixes
the problem by asking for underlaying block device the number
of pages to send with each BIO.

41b93bc logfs: maintain the ordering of meta-inode destruction
LogFS maintains file system meta-data in special inodes. These
inodes are releated to each other, therefore they must be
destroyed in a proper order.

ddb24bb logfs: create a pagecache page if it is not present

cd8bfa9 logfs: initialize the number of iovecs in bio
LogFS used to panic when it was created on an encrypted LVM
volume. The patch fixes the problem by properly initializing
the BIO.

d2dcd90 logfs: destroy the reserved inodes while unmounting

Sorry for multiple mails and inconvenience it might have caused.

Thanks and Regards,
Prasad

  fs/logfs/dev_bdev.c  |   15 +++
  fs/logfs/inode.c |   18 +-
  fs/logfs/journal.c   |2 +-
  fs/logfs/readwrite.c |1 -
  fs/logfs/segment.c   |2 +-
  5 files changed, 26 insertions(+), 12 deletions(-)

 Please note that the signed tag (for-linus) is applied and the same is
 pushed. The repository is also added in the 'linux-next' and there no
 conflicts in the 'linux-next: Tree for Aug 24'.

 Thanks and Warm Regards,
 Prasad
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/