Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1265672
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mmc: add ifdef around fault_create_debugfs_attr() |
| Date | 2015-11-09 14:40 +0100 |
| Message-ID | <qsUPV-70f-35@gated-at.bofh.it> (permalink) |
| References | <qrO9P-4nf-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 6 November 2015 at 13:15, Adrien Schildknecht <adrien+dev@schischi.me> wrote:
> FAIL_MMC_REQUEST can be used without FAULT_INJECTION_DEBUG_FS.
> In this case fault_create_debugfs_attr() will always return an error and
> lead to the deletion of the whole debugfs directory.
>
> This patch makes sure that FAULT_INJECTION_DEBUG_FS is enabled before
> attempting to create the debugfs atttribute.
>
> Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
> ---
> drivers/mmc/core/debugfs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 154aced..13e842c 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -259,11 +259,13 @@ void mmc_add_host_debugfs(struct mmc_host *host)
> if (fail_request)
> setup_fault_attr(&fail_default_attr, fail_request);
> host->fail_mmc_request = fail_default_attr;
> +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
> if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request",
> root,
> &host->fail_mmc_request)))
> goto err_node;
> #endif
> +#endif
> return;
>
> err_node:
> --
> 2.6.2
>
I think you are solving this in the wrong way. Will it really makes
sense to use FAIL_MMC_REQUEST unless FAULT_INJECTION_DEBUG_FS is set,
I don't think so.
I suggest you to change FAIL_MMC_REQUEST from depending on
FAULT_INJECTION to FAULT_INJECTION_DEBUG_FS in /lib/Kconfig.debug.
Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mmc: add ifdef around fault_create_debugfs_attr() Adrien Schildknecht <adrien+dev@schischi.me> - 2015-11-06 13:20 +0100
Re: [PATCH] mmc: add ifdef around fault_create_debugfs_attr() Ulf Hansson <ulf.hansson@linaro.org> - 2015-11-09 14:40 +0100
Re: [PATCH] mmc: add ifdef around fault_create_debugfs_attr() Adrien Schildknecht <adrien+dev@schischi.me> - 2015-11-10 16:10 +0100
Re: [PATCH] mmc: add ifdef around fault_create_debugfs_attr() Ulf Hansson <ulf.hansson@linaro.org> - 2015-11-10 18:30 +0100
[PATCH v2] mmc: kconfig: replace FAULT_INJECTION with FAULT_INJECTION_DEBUG_FS Adrien Schildknecht <adrien+dev@schischi.me> - 2015-11-10 20:20 +0100
csiph-web