btrfs-progs: cmds: Fix build for using NAME_MAX
PATCH 1/1 btrfs-progs: cmds: Fix build for using NAME_MAX
There is some code that using NAME_MAX but it doesn't include header that is defined. This patch adds a line that includes linux/limits.h which defines NAME_MAX.
--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Signature · 1 line
2.25.1
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header that is defined. This patch adds a line that includeslinux/limits.hwhich definesNAME_MAX.
I guess it's related to this issue?
https://github.com/kdave/btrfs-progs/issues/386
Thanks,
Qu
Quoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 10 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header that is defined. This patch adds a line that includeslinux/limits.hwhich definesNAME_MAX.I guess it's related to this issue?
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
Thanks,
Sidong
Quoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Qu Wenruo
Reviewed-byQuoted 8 lines · Sidong Yang
Quoted 7 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header that is defined. This patch adds a line that includeslinux/limits.hwhich definesNAME_MAX.
Quoted 6 lines
Quoted 3 lines
I guess it's related to this issue?
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
No, I just want to mention you could add tag like the below, so David can be more aware of the fix.
As when it merged into devel branch, github will automatically mention it in the issue.
Issue: #386
And it looks good to me, so:
Thanks,
Qu
Quoted 27 lines
Thanks,
SidongQuoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 18 lines · Qu Wenruo
Quoted 8 lines · Sidong Yang
Quoted 7 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header that is defined. This patch adds a line that includeslinux/limits.hwhich definesNAME_MAX.Quoted 6 lines
Quoted 3 lines
I guess it's related to this issue?
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
Quoted 8 lines
No, I just want to mention you could add tag like the below, so David can be more aware of the fix.
As when it merged into devel branch, github will automatically mention it in the issue.Issue: #386
And it looks good to me, so:
Thanks, I'll do it for next time.
Thanks,
Sidong
Quoted 32 lines
Reviewed-by Qu Wenruo <[email protected]>Thanks,
QuQuoted 27 lines
Thanks,
SidongQuoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 8 lines · Sidong Yang
Quoted 7 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header that is defined. This patch adds a line that includeslinux/limits.hwhich definesNAME_MAX.
Quoted 7 lines
Quoted 3 lines
I guess it's related to this issue?
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
Good fix. But there is one PR before the issue creation:
https://github.com/kdave/btrfs-progs/pull/385
--
Su
Quoted 26 lines
Thanks,
SidongQuoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 15 lines · Su Yue
Quoted 12 lines · Sidong Yang
Quoted 11 lines · Qu Wenruo
Quoted 1 line · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include >header
Quoted 1 line
that is defined. This patch adds a line that includes >
linux/limits.hQuoted 1 line
which defines
NAME_MAX.I guess it's related to this issue?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
Good fix. But there is one PR before the issue creation:
https://github.com/kdave/btrfs-progs/pull/385
Thanks, I didn't know about this. I don't care which patch will be committed.
Thanks,
Sidong
Quoted 30 lines
--
SuQuoted 26 lines
Thanks,
SidongQuoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>--- cmds/filesystem-usage.c | 1 + 1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@#include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 13 lines · Su Yue
Quoted 10 lines · Sidong Yang
Quoted 9 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include > header that is defined. This patch adds a line that includes >linux/limits.hwhich definesNAME_MAX.I guess it's related to this issue?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Yeah, It seems that there is no patch for this yet. So I sent this patch. Is this too minor patch?
Good fix. But there is one PR before the issue creation:
https://github.com/kdave/btrfs-progs/pull/385
No wonder why I didn't see any automatic mention in that issue, this fix lacks the "Issue:" tag either...
Quoted 30 lines
--
SuQuoted 26 lines
Thanks,
SidongQuoted 23 lines
Thanks,
QuQuoted 19 lines
Signed-off-by Sidong Yang <[email protected]>---
cmds/filesystem-usage.c| 1 +1 file changed, 1 insertion(+)cmds/filesystem-usage.c +1
-0@@ -24,6 +24,7 @@ #include <stdarg.h> #include <getopt.h> #include <fcntl.h> +#include <linux/limits.h> #include "common/utils.h" #include "kerncompat.h"
Quoted 16 lines · Su Yue
Quoted 12 lines · Sidong Yang
Quoted 11 lines · Qu Wenruo
Quoted 5 lines · Sidong Yang
There is some code that using
NAME_MAXbut it doesn't include header
that is defined. This patch adds a line that includeslinux/limits.h
which definesNAME_MAX.I guess it's related to this issue?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Yeah, It seems that there is no patch for this yet. So I sent this
patch. Is this too minor patch?Good fix. But there is one PR before the issue creation:
https://github.com/kdave/btrfs-progs/pull/385
Ah I got an email about the musl failure but was not able to find it so I created #386 to keep track of it. While the pull request comes with a patch it should really be linux/limits.h because it's a linux-specific limit. Including limits.h also works but I'd prefer to pull the one that defines it.