[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABVgOSn7tTYuMZ8ArA3fRWp4aeKAcKJ3qNL+SgtFt5fkBLnc-A@mail.gmail.com>
Date: Thu, 5 Dec 2019 09:50:59 -0800
From: David Gow <davidgow@...gle.com>
To: Brendan Higgins <brendanhiggins@...gle.com>
Cc: valdis.kletnieks@...edu, linux-fsdevel@...r.kernel.org,
devel@...verdev.osuosl.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1] staging: exfat: fix multiple definition error of `rename_file'
On Wed, Dec 4, 2019 at 3:46 PM Brendan Higgins
<brendanhiggins@...gle.com> wrote:
>
> `rename_file' was exported but not properly namespaced causing a
> multiple definition error because `rename_file' is already defined in
> fs/hostfs/hostfs_user.c:
>
> ld: drivers/staging/exfat/exfat_core.o: in function `rename_file':
> drivers/staging/exfat/exfat_core.c:2327: multiple definition of
> `rename_file'; fs/hostfs/hostfs_user.o:fs/hostfs/hostfs_user.c:350:
> first defined here
> make: *** [Makefile:1077: vmlinux] Error 1
>
> This error can be reproduced on ARCH=um by selecting:
>
> CONFIG_EXFAT_FS=y
> CONFIG_HOSTFS=y
>
> Add a namespace prefix exfat_* to fix this error.
>
> Reported-by: Brendan Higgins <brendanhiggins@...gle.com>
> Signed-off-by: Brendan Higgins <brendanhiggins@...gle.com>
> Cc: Valdis Kletnieks <valdis.kletnieks@...edu>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Tested-by: David Gow <davidgow@...gle.com>
Reviewed-by: David Gow <davidgow@...gle.com>
This works for me: I was able to reproduce the compile error without
this patch, and successfully compile a UML kernel and mount an exfat
fs after applying it.
> ---
> drivers/staging/exfat/exfat.h | 4 ++--
> drivers/staging/exfat/exfat_core.c | 4 ++--
> drivers/staging/exfat/exfat_super.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
> index 2aac1e000977e..51c665a924b76 100644
> --- a/drivers/staging/exfat/exfat.h
> +++ b/drivers/staging/exfat/exfat.h
> @@ -805,8 +805,8 @@ s32 create_dir(struct inode *inode, struct chain_t *p_dir,
> s32 create_file(struct inode *inode, struct chain_t *p_dir,
> struct uni_name_t *p_uniname, u8 mode, struct file_id_t *fid);
> void remove_file(struct inode *inode, struct chain_t *p_dir, s32 entry);
> -s32 rename_file(struct inode *inode, struct chain_t *p_dir, s32 old_entry,
> - struct uni_name_t *p_uniname, struct file_id_t *fid);
> +s32 exfat_rename_file(struct inode *inode, struct chain_t *p_dir, s32 old_entry,
> + struct uni_name_t *p_uniname, struct file_id_t *fid);
> s32 move_file(struct inode *inode, struct chain_t *p_olddir, s32 oldentry,
> struct chain_t *p_newdir, struct uni_name_t *p_uniname,
> struct file_id_t *fid);
It seems a bit ugly to add the exfat_ prefix to just rename_file,
rather than all of the above functions (e.g., create_dir, remove_file,
etc). It doesn't look like any of the others are causing any issues
though (while, for example, there is another remove_file in
drivers/infiniband/hw/qib/qib_fs.c, it's static, so shouldn't be a
problem).
-- David
Powered by blists - more mailing lists