lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKUZ0zJUgFmoKv1oDguhEYWYxxFaKthCp6wY-ahsR8KWy-nqKg@mail.gmail.com>
Date: Tue, 8 Apr 2025 01:42:00 -0400
From: Gabriel Shahrouzi <gshahrouzi@...il.com>
To: Coly Li <colyli@...nel.org>
Cc: Kent Overstreet <kent.overstreet@...ux.dev>, linux-bcache@...r.kernel.org, 
	linux-kernel@...r.kernel.org, skhan@...uxfoundation.org, 
	kernelmentees@...ts.linuxfoundation.org
Subject: Re: [PATCH 1/2] bcache: Fix undeclared symbol warning for bcache_is_reboot

On Tue, Apr 8, 2025 at 12:55 AM Coly Li <colyli@...nel.org> wrote:
>
> On Mon, Apr 07, 2025 at 11:33:21PM +0800, Gabriel Shahrouzi wrote:
> > Add extern declaration for bcache_is_reboot to bcache.h. Ensure proper
> > visibility for use across multiple files (super.c, sysfs.c) and follow
> > the declaration pattern for other forward declarations.
> >
> > Signed-off-by: Gabriel Shahrouzi <gshahrouzi@...il.com>
> > ---
> >  drivers/md/bcache/bcache.h | 1 +
> >  drivers/md/bcache/sysfs.c  | 2 --
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
> > index 785b0d9008fac..531933351b8b8 100644
> > --- a/drivers/md/bcache/bcache.h
> > +++ b/drivers/md/bcache/bcache.h
> > @@ -1007,6 +1007,7 @@ extern struct workqueue_struct *bch_journal_wq;
> >  extern struct workqueue_struct *bch_flush_wq;
> >  extern struct mutex bch_register_lock;
> >  extern struct list_head bch_cache_sets;
> > +extern bool bcache_is_reboot;
> >
>
> NACK. It is uncessary to make more .c files to be aware of
> bcache_is_reboot. Current code is in better form IMHO.
Ah I see. It's only used in sysfs.c and super.c compared to the other
forward declarations. Limiting the scope to only those files makes the
most sense instead of including it in the header file.
>
>
> >  extern const struct kobj_type bch_cached_dev_ktype;
> >  extern const struct kobj_type bch_flash_dev_ktype;
> > diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> > index e8f696cb58c05..47ef0167b9d23 100644
> > --- a/drivers/md/bcache/sysfs.c
> > +++ b/drivers/md/bcache/sysfs.c
> > @@ -17,8 +17,6 @@
> >  #include <linux/sort.h>
> >  #include <linux/sched/clock.h>
> >
> > -extern bool bcache_is_reboot;
> > -
> >  /* Default is 0 ("writethrough") */
> >  static const char * const bch_cache_modes[] = {
> >       "writethrough",
> > --
> > 2.43.0
> >
>
> --
> Coly Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ