Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-30 Thread Changwei Ge
On 2018/3/30 10:38, Joseph Qi wrote: > > > On 18/3/30 10:17, Changwei Ge wrote: > Since we assume caller has to pass either all NULL or all non-NULL, > here we will only put bh internal allocated. Am I missing something? Thanks for your review. Yes, we will only put bh

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Joseph Qi
On 18/3/30 10:17, Changwei Ge wrote: Since we assume caller has to pass either all NULL or all non-NULL, here we will only put bh internal allocated. Am I missing something? >>> Thanks for your review. >>> Yes, we will only put bh internally allocated. >>> If bh is reserved in advance,

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Joseph, On 2018/3/30 10:04, Joseph Qi wrote: > > > On 18/3/30 09:31, Changwei Ge wrote: >> Hi Joseph, >> >> On 2018/3/30 9:27, Joseph Qi wrote: >>> >>> >>> On 18/3/29 10:06, Changwei Ge wrote: ocfs2_read_blocks() is used to read several blocks from disk. Currently, the input

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread piaojun
Hi Joseph and Changwei, On 2018/3/30 9:26, Joseph Qi wrote: > > > On 18/3/29 10:06, Changwei Ge wrote: >> ocfs2_read_blocks() is used to read several blocks from disk. >> Currently, the input argument *bhs* can be NULL or NOT. It depends on >> the caller's behavior. If the function fails in

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Joseph Qi
On 18/3/30 09:31, Changwei Ge wrote: > Hi Joseph, > > On 2018/3/30 9:27, Joseph Qi wrote: >> >> >> On 18/3/29 10:06, Changwei Ge wrote: >>> ocfs2_read_blocks() is used to read several blocks from disk. >>> Currently, the input argument *bhs* can be NULL or NOT. It depends on >>> the caller's

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Joseph, On 2018/3/30 9:27, Joseph Qi wrote: > > > On 18/3/29 10:06, Changwei Ge wrote: >> ocfs2_read_blocks() is used to read several blocks from disk. >> Currently, the input argument *bhs* can be NULL or NOT. It depends on >> the caller's behavior. If the function fails in reading blocks

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Joseph Qi
On 18/3/29 10:06, Changwei Ge wrote: > ocfs2_read_blocks() is used to read several blocks from disk. > Currently, the input argument *bhs* can be NULL or NOT. It depends on > the caller's behavior. If the function fails in reading blocks from > disk, the corresponding bh will be assigned to NULL

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Andrew, On 2018/3/30 5:45, Andrew Morton wrote: > On Thu, 29 Mar 2018 10:06:02 +0800 Changwei Ge wrote: > >> ocfs2_read_blocks() is used to read several blocks from disk. >> Currently, the input argument *bhs* can be NULL or NOT. It depends on >> the caller's behavior.

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Andrew Morton
On Thu, 29 Mar 2018 10:06:02 +0800 Changwei Ge wrote: > ocfs2_read_blocks() is used to read several blocks from disk. > Currently, the input argument *bhs* can be NULL or NOT. It depends on > the caller's behavior. If the function fails in reading blocks from > disk, the

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Larry, On 2018/3/29 18:33, Larry Chen wrote: > Hi Changwei, > > On 03/29/2018 05:50 PM, piaojun wrote: >> Hi Changwei, >> >> On 2018/3/29 10:06, Changwei Ge wrote: >>> ocfs2_read_blocks() is used to read several blocks from disk. >>> Currently, the input argument *bhs* can be NULL or NOT. It

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Jun, On 2018/3/29 17:51, piaojun wrote: > Hi Changwei, > > On 2018/3/29 10:06, Changwei Ge wrote: >> ocfs2_read_blocks() is used to read several blocks from disk. >> Currently, the input argument *bhs* can be NULL or NOT. It depends on >> the caller's behavior. If the function fails in

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Larry Chen
Hi Changwei, On 03/29/2018 05:50 PM, piaojun wrote: > Hi Changwei, > > On 2018/3/29 10:06, Changwei Ge wrote: >> ocfs2_read_blocks() is used to read several blocks from disk. >> Currently, the input argument *bhs* can be NULL or NOT. It depends on >> the caller's behavior. If the function fails

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread piaojun
Hi Changwei, On 2018/3/29 10:06, Changwei Ge wrote: > ocfs2_read_blocks() is used to read several blocks from disk. > Currently, the input argument *bhs* can be NULL or NOT. It depends on > the caller's behavior. If the function fails in reading blocks from > disk, the corresponding bh will be

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-29 Thread Changwei Ge
Hi Gang, On 2018/3/29 11:22, Gang He wrote: > Hi Changwei, > > >> Hi Gang, >> >> On 2018/3/29 10:36, Gang He wrote: >>> Hello Changwei, >>> >>> >>> Do you have the related crash backtrace? >> This patch has been pending in my tree for quite a long time and sadly I >> can't >> find the back

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-28 Thread Larry Chen
Hi Changwei, I found that your patch call put_bh function only if new_bh==1, Will it cause buffer_head use count inconsistent?? Thanks Larry On 03/29/2018 10:06 AM, Changwei Ge wrote: > ocfs2_read_blocks() is used to read several blocks from disk. > Currently, the input argument *bhs* can be

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-28 Thread Gang He
Hi Changwei, >>> > Hi Gang, > > On 2018/3/29 10:36, Gang He wrote: >> Hello Changwei, >> >> >> Do you have the related crash backtrace? > This patch has been pending in my tree for quite a long time and sadly I > can't > find the back trace right now. But we can still find the risk by

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-28 Thread Changwei Ge
Hi Gang, On 2018/3/29 10:36, Gang He wrote: > Hello Changwei, > > > Do you have the related crash backtrace? This patch has been pending in my tree for quite a long time and sadly I can't find the back trace right now. But we can still find the risk by reviewing related code. :) > Maybe I

Re: [Ocfs2-devel] [PATCH] ocfs2: don't evaluate buffer head to NULL managed by caller

2018-03-28 Thread Gang He
Hello Changwei, Do you have the related crash backtrace? Maybe I feel that new adding check is not necessary. since the below code has make sure all buffer head is NOT NULL before reading block. 216 ocfs2_metadata_cache_io_lock(ci); 217 for (i = 0 ; i < nr ; i++) { 218