Re: [Ocfs2-devel] [PATCH] ocfs2/o2hb: check len for bio_add_page() to avoid submitting incorrect bio

2018-03-28 Thread Joseph Qi
On 18/3/28 15:02, piaojun wrote: > Hi Joseph, > > On 2018/3/28 12:58, Joseph Qi wrote: >> >> >> On 18/3/28 11:50, piaojun wrote: >>> We need check len for bio_add_page() to make sure the bio has been set up >>> correctly, otherwise we may submit incorrect data to device. >>> >>> Signed-off-by:

Re: [Ocfs2-devel] [PATCH] ocfs2/o2hb: check len for bio_add_page() to avoid submitting incorrect bio

2018-03-28 Thread piaojun
Hi Changwei and Joseph, EIO sounds more reasonable, thanks a lot for your suggestions, and I will send patch v2 later. thanks, Jun On 2018/3/29 9:09, Changwei Ge wrote: > Hi Jun, > > On 2018/3/28 17:51, Joseph Qi wrote: >> >> >> On 18/3/28 15:02, piaojun wrote: >>> Hi Joseph, >>> >>> On

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 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/o2hb: check len for bio_add_page() to avoid submitting incorrect bio

2018-03-28 Thread Changwei Ge
Hi Jun, On 2018/3/28 17:51, Joseph Qi wrote: > > > On 18/3/28 15:02, piaojun wrote: >> Hi Joseph, >> >> On 2018/3/28 12:58, Joseph Qi wrote: >>> >>> >>> On 18/3/28 11:50, piaojun wrote: We need check len for bio_add_page() to make sure the bio has been set up correctly, otherwise we

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

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

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

2018-03-28 Thread Changwei Ge
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 and put. Obviously, above process for