[PATCH] erofs: fix an error code in z_erofs_init_zip_subsystem()

2023-02-16 Thread Dan Carpenter
Return -ENOMEM if alloc_workqueue() fails. Don't return success. Fixes: d8a650adf429 ("erofs: add per-cpu threads for decompression as an option") Signed-off-by: Dan Carpenter --- fs/erofs/zdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/erofs/zd

Re: [PATCH] erofs: clean up a loop

2022-07-18 Thread Dan Carpenter
On Mon, Jul 18, 2022 at 07:36:14PM +0800, Gao Xiang wrote: > Hi Dan, > > On Mon, Jul 18, 2022 at 02:20:08PM +0300, Dan Carpenter wrote: > > It's easier to see what this loop is doing when the decrement is in > > the normal place. > > > > Signed-off-by: Dan

[PATCH] erofs: clean up a loop

2022-07-18 Thread Dan Carpenter
It's easier to see what this loop is doing when the decrement is in the normal place. Signed-off-by: Dan Carpenter --- fs/erofs/zdata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 601cfcb07c50..2691100eb231 100644 --- a/fs

Re: [PATCH -next] erofs: fix error return code in erofs_read_superblock()

2021-05-19 Thread Dan Carpenter
ixes: b858a4844cfb ("erofs: support superblock checksum") regards, dan carpenter

[bug report] staging: erofs: tidy up decompression frontend

2019-11-14 Thread Dan Carpenter
gt;owned_head == Z_EROFS_PCLUSTER_TAIL) 449 clt->tailpcl = pcl; 450 clt->owned_head = >next; 451 clt->pcl = pcl; 452 clt->cl = cl; 453 return 0; regards, dan carpenter

Re: [PATCH v3 6/7] erofs: remove all likely/unlikely annotations

2019-08-30 Thread Dan Carpenter
On Fri, Aug 30, 2019 at 11:36:42AM +0800, Gao Xiang wrote: > As Dan Carpenter suggested [1], I have to remove > all erofs likely/unlikely annotations. > > [1] https://lore.kernel.org/linux-fsdevel/20190829154346.GK23584@kadam/ > Reported-by: Dan Carpenter > Signed

Re: [PATCH] staging: erofs: using switch-case while checking the inode type.

2019-08-29 Thread Dan Carpenter
tive" mean here? Now that it's out of staging we aren't applying clean up patches? regards, dan carpenter

Re: [PATCH] staging: erofs: using switch-case while checking the inode type.

2019-08-29 Thread Dan Carpenter
ng". > and I will review it then. > > p.s. if someone argues here or there, there will be endless > issues since there is no standard at all. More complaining... It doesn't matter if you can find ext4 that looks like dog poop, that's irrelevant. regards, dan carpenter

Re: [bug report] staging: erofs: introduce erofs_grab_bio

2019-08-28 Thread Dan Carpenter
ave CONFIG_EROFS_FS_DEBUG disabled. Plus it has "DBG" in the name so it felt like debug code. But I ended up focussing on it instead of seeing the "(nofail ? __GFP_NOFAIL : 0)" bit. The DBG_BUGON() is unreachable and misleading nonsense fluff. :( regards, dan carpenter

Re: [bug report] staging: erofs: introduce erofs_grab_bio

2019-08-28 Thread Dan Carpenter
On Wed, Aug 28, 2019 at 07:02:49PM +0800, Gao Xiang wrote: > Hi Dan, > > On Wed, Aug 28, 2019 at 01:55:41PM +0300, Dan Carpenter wrote: > > Hello Gao Xiang, > > > > The patch 8be31270362b: "staging: erofs: introduce erofs_grab_bio" > > from Aug 21,

[bug report] staging: erofs: introduce erofs_grab_bio

2019-08-28 Thread Dan Carpenter
last_index = first_index + i; 1278 skippage: 1279 if (++i < clusterpages) 1280 goto repeat; regards, dan carpenter

Re: [bug report] staging: erofs: tidy up decompression frontend

2019-08-27 Thread Dan Carpenter
It turns out that my Smatch cross function DB was slightly out of date after the move from staging/ to fs/. Once I rebuilt the DB then the warning went away. Anyway, thanks for taking the time to look at this. regards, dan carpenter

Re: [bug report] staging: erofs: tidy up decompression frontend

2019-08-27 Thread Dan Carpenter
On Tue, Aug 27, 2019 at 05:36:29PM +0800, Gao Xiang wrote: > Hi Dan, > > Thanks for your report. > > On Tue, Aug 27, 2019 at 12:03:55PM +0300, Dan Carpenter wrote: > > Hello Gao Xiang, > > > > This is a semi-automatic email about new static checker warnings

[bug report] staging: erofs: tidy up decompression frontend

2019-08-27 Thread Dan Carpenter
of a page */ 668 ++spiltted; 669 /* also update nr_pages */ 670 clt->cl->nr_pages = max_t(pgoff_t, clt->cl->nr_pages, index + 1); ^ ^ Unchecked dereferences. 671 next_part: 672 /* can be used for verification */ regards, dan carpenter

Re: [PATCH v2 2/2] staging: erofs: fix i_blocks calculation

2019-05-28 Thread Dan Carpenter
le32_to_cpu(v2->i_ctime_nsec); > > > > inode->i_size = le64_to_cpu(v2->i_size); > > + > > + /* total blocks for compressed files */ > > + if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) > > + nblks = v2->i_u.compressed_blocks; > > Xiang, > > It needs to use le32_to_cpu(). ;) > I wonder it the kbuild bot is going to send an email about that... Hopefully these sorts of bugs get detected with Sparse CF=-D__CHECK_ENDIAN__ regards, dan carpenter

Re: [PATCH v2] staging: erofs: fix unexpected out-of-bound data access

2019-04-12 Thread Dan Carpenter
out in the previous email [1]. > > [1] https://lore.kernel.org/lkml/20190411080953.GE421@ming.t460p/ > Please also use the Fixes tag. Fixes: 07173c3ec276 ("block: enable multipage bvecs") > Suggested-by: Ming Lei > Reviewed-by: Chao Yu > Signed-off-by: Gao Xiang regards, dan carpenter

Re: [PATCH v2] staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()

2019-02-15 Thread Dan Carpenter
On Fri, Feb 15, 2019 at 05:32:33PM +0800, Chao Yu wrote: > On 2019/2/15 15:57, Dan Carpenter wrote: > > On Fri, Feb 15, 2019 at 03:02:25PM +0800, Chao Yu wrote: > >> On 2019/2/1 20:16, Gao Xiang wrote: > >>> + /* > >>> + * on-disk erro

Re: [PATCH v2] staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()

2019-02-14 Thread Dan Carpenter
DBG_BUGON(1); > return 1; > } Please don't add likely/unlikely() annotations unless you have benchmarked it and it makes a difference. regards, dan carpenter

Re: [PATCH v2 2/2] staging: erofs: complete POSIX ACL support

2019-02-14 Thread Dan Carpenter
. Over time it would be good to improve and expand the standard kernel error injection frameworks to cover more types. regards, dan carpenter

Re: patch "staging: erofs: keep corrupted fs from crashing kernel in" added to staging-linus

2019-01-30 Thread Dan Carpenter
any need to panic or rush. It was just the kunmap_atomic() which only affects corrupted filesystem on linux-next so it's not a big deal. The rest was just my style grumblings and could have been addressed later or even ignored. regards, dan carpenter

Re: [PATCH] staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()

2019-01-30 Thread Dan Carpenter
nd_target_block_classic( > if (likely(!IS_ERR(candidate))) ^^ Not related to the this patch, but I wonder how this works. IS_ERR() already has an opposite unlikely() inside so I wonder which trumps the other? > put_page(candidate); > candidate = page; > + *_ndirents = ndirents; regards, dan carpenter

Re: [PATCH v2 2/2] staging: erofs: complete POSIX ACL support

2019-01-28 Thread Dan Carpenter
there is an explanation. regards, dan carpenter

Re: [PATCH v2 2/2] staging: erofs: complete POSIX ACL support

2019-01-28 Thread Dan Carpenter
t; > +{ > > + struct posix_acl *acl; > > + int ea_prefix, rc; > > + char *value = NULL; > > + > > + switch(type) { > > + case ACL_TYPE_ACCESS: > > + ea_prefix = EROFS_XATTR_INDEX_POSIX_ACL_ACCESS; > > + break; > > + case ACL_TYPE_DEFAULT: > > + ea_prefix = EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT; > > + break; > > + default: > > + return ERR_PTR(-EINVAL); > > + } > > + > > + rc = erofs_getxattr(inode, ea_prefix, "", NULL, 0); > > + if (rc > 0) { > > + value = kvmalloc(rc, GFP_KERNEL); > > erofs_kmalloc() is enough? > > Thanks, > Hopefully, regular kmalloc() is enough. Do really need the erofs_kmalloc() function? Regular kmalloc() has fault injection already. Have you tried to use it? regards, dan carpenter

Re: [PATCH 2/2] staging: erofs: complete POSIX ACL support

2019-01-25 Thread Dan Carpenter
I will test it asap... This is an awkward thing. Just don't send it until after you test it. We also ignore RFC patches so if you mark it as RFC that will be ignored if you want. regards, dan carpenter

Re: [PATCH 1/2] staging: erofs: use xattr_prefix to wrap up

2019-01-25 Thread Dan Carpenter
> /* Note that at least one of 'prefix' and 'name' should be non-NULL */ The comment is sort of confusing now. > - prefix = h->prefix != NULL ? h->prefix : h->name; > + prefix = xattr_prefix(h); > prefix_len = strlen(prefix); regards, dan carpenter

Re: [PATCH 3/5] staging: erofs: decrease the shrink count in erofs_workgroup_get

2019-01-16 Thread Dan Carpenter
On Wed, Jan 16, 2019 at 04:59:54PM +0800, Gao Xiang wrote: > It is more suitable to update in erofs_workgroup_get since > it's actually the one matched with erofs_workgroup_put. > This patch is fine. No need to resend. Reviewed-by: Dan Carpenter But for future reference, I found t

Re: [PATCH 1/5] drivers: staging: erofs: Fix alignment.

2018-12-11 Thread Dan Carpenter
LocalWords: Alighnment ^^^ Remove this. Please wait at least a day before resending a patch. regards, dan carpenter

Re: [PATCH] staging: erofs: harden inode lookup for 32-bit platforms

2018-10-11 Thread Dan Carpenter
On Thu, Oct 11, 2018 at 06:49:57PM +0800, Gao Xiang wrote: > Hi Dan, > > On 2018/10/11 18:18, Dan Carpenter wrote: > > On Thu, Oct 11, 2018 at 05:46:26PM +0800, Gao Xiang wrote: > >> > >> > >> On 2018/10/11 16:44, Dan Carpenter wrote: > >>&g

Re: [PATCH 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Dan Carpenter
he cross function DB twice to make the warning go away. It could be because it starts out with the old vle_get_logical_extent_head() information so it thinks it knows how that function works. regards, dan carpenter

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
> But it is better to fix them in an independent patch. :) Yah. Of course. This was completely unrelated. regards, dan carpenter

Re: [PATCH 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Dan Carpenter
Yeah. You'd have to remove the const. Anyway, on looking at it more, I guess this patch is fine for now. We will probably end up changing z_erofs_vle_work_lookup() and z_erofs_vle_work_register() some more in the future. regards, dan carpenter

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
turn values other than 0 and ENOATTR(ENODATA) rarely happens, > it should be in the slow path... > What I'm trying to say is please stop adding so many likely/unlikely annotations. You should only add them if you have the benchmark data to show the it really is required. regards, dan carpenter

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
e callers all treate zero and one the same so there isn't any reason to propogate the 1 back. regards, dan carpenter

Re: [PATCH 6/8] staging: erofs: fix vle_decompressed_index_clusterofs

2018-08-13 Thread Dan Carpenter
inline. Leave it to the compiler to decide. regards, dan carpenter

Re: [PATCH 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Dan Carpenter
ork; > > - egrp = erofs_find_workgroup(sb, idx, ); > + egrp = erofs_find_workgroup(f->sb, f->idx, ); > if (egrp == NULL) { > - *grp_ret = NULL; > + *f->grp_ret = NULL; All these pointers to pointer seem a bit messy. Just do this: struct z_erofs_vle_workgroup *grp; Then replace "grp" in z_erofs_vle_work_iter_begin() with finder.grp; regards, dan carpenter

Re: [PATCH 2/8] staging: erofs: separate erofs_get_meta_page

2018-08-13 Thread Dan Carpenter
unlock_page(page); > - put_page(page); > - > - page = ERR_PTR(-EIO); > + if (io_retries) { > + --io_retries; > + goto unlock_repeat; > + } > + err = -EIO; > + goto err_out; regards, dan carpenter

Re: [PATCH RESEND 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 05:36:54PM +0800, Gao Xiang wrote: > This patch adds a missing break after adding the default case. > > Reviewed-by: Chao Yu > Signed-off-by: Gao Xiang > --- > As pointed out by Dan Carpenter: > - fix the wrong place of fallthrough comments Thank