Skip to contentSkip to conversation

btrfs-progs: cmds: Fix build for using NAME_MAX

PATCH Superseded Sidong Yang 4 participants 9 messages Jul 24, 2021 – Jul 26, 2021 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index 50d8995e..2a76e29c 100644
@@ -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
#1 lore raw
Quoted 3 lines · Sidong Yang

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.

I guess it's related to this issue?

https://github.com/kdave/btrfs-progs/issues/386

Thanks,
Qu

Quoted 19 lines
---
  cmds/filesystem-usage.c | 1 +
  1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
  #include <stdarg.h>
  #include <getopt.h>
  #include <fcntl.h>
+#include <linux/limits.h>
 
  #include "common/utils.h"
  #include "kerncompat.h"
#2 lore raw
Quoted 10 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang

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.

I guess it's related to this issue?

https://github.com/kdave/btrfs-progs/issues/386

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,
Qu

Quoted 19 lines
---
  cmds/filesystem-usage.c | 1 +
  1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
  #include <stdarg.h>
  #include <getopt.h>
  #include <fcntl.h>
+#include <linux/limits.h>
 
  #include "common/utils.h"
  #include "kerncompat.h"
Reviewed-by
#3 lore raw
Quoted 8 lines · Sidong Yang
Quoted 7 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang

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.

Quoted 6 lines
Quoted 3 lines

I guess it's related to this issue?

https://github.com/kdave/btrfs-progs/issues/386

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,
Sidong

Quoted 23 lines

Thanks,
Qu

Quoted 19 lines
---
   cmds/filesystem-usage.c | 1 +
   1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
   #include <stdarg.h>
   #include <getopt.h>
   #include <fcntl.h>
+#include <linux/limits.h>
 
   #include "common/utils.h"
   #include "kerncompat.h"
#4 lore raw
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_MAX but it doesn't include header that is defined. This patch adds a line that includes linux/limits.h which defines NAME_MAX.

Quoted 6 lines
Quoted 3 lines

I guess it's related to this issue?

https://github.com/kdave/btrfs-progs/issues/386

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

Thanks,
Qu

Quoted 27 lines

Thanks,
Sidong

Quoted 23 lines

Thanks,
Qu

Quoted 19 lines
---
   cmds/filesystem-usage.c | 1 +
   1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
   #include <stdarg.h>
   #include <getopt.h>
   #include <fcntl.h>
+#include <linux/limits.h>
 
   #include "common/utils.h"
   #include "kerncompat.h"
#5 lore raw
In reply to Sidong Yang
Quoted 8 lines · Sidong Yang
Quoted 7 lines · Qu Wenruo
Quoted 3 lines · Sidong Yang

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.

Quoted 7 lines
Quoted 3 lines

I guess it's related to this issue?

https://github.com/kdave/btrfs-progs/issues/386

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,
Sidong

Quoted 23 lines

Thanks,
Qu

Quoted 19 lines
---
  cmds/filesystem-usage.c | 1 +
  1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
  #include <stdarg.h>
  #include <getopt.h>
  #include <fcntl.h>
+#include <linux/limits.h>
 
  #include "common/utils.h"
  #include "kerncompat.h"
#6 lore raw
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_MAX but it doesn't include >

header

Quoted 1 line

that is defined. This patch adds a line that includes >

linux/limits.h

Quoted 1 line

which defines NAME_MAX.

I guess it's related to this issue?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

https://github.com/kdave/btrfs-progs/issues/386

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

--
Su

Quoted 26 lines

Thanks,
Sidong

Quoted 23 lines

Thanks,
Qu

Quoted 19 lines
---
  cmds/filesystem-usage.c | 1 +
  1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
  #include <stdarg.h>
  #include <getopt.h>
  #include <fcntl.h>
+#include <linux/limits.h>
 
  #include "common/utils.h"
  #include "kerncompat.h"
#7 lore raw
In reply to Su Yue
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_MAX but it doesn't include > header that is defined. This patch adds a line that includes > linux/limits.h which defines NAME_MAX.

I guess it's related to this issue?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

https://github.com/kdave/btrfs-progs/issues/386

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

--
Su

Quoted 26 lines

Thanks,
Sidong

Quoted 23 lines

Thanks,
Qu

Quoted 19 lines

---
   cmds/filesystem-usage.c | 1 +

   1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
    #include <stdarg.h>
    #include <getopt.h>
    #include <fcntl.h>
+#include <linux/limits.h>
 
    #include "common/utils.h"
    #include "kerncompat.h"
#8 lore raw
In reply to Su Yue
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_MAX but it doesn't include header
that is defined. This patch adds a line that includes linux/limits.h
which defines NAME_MAX.

I guess it's related to this issue?

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

https://github.com/kdave/btrfs-progs/issues/386

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.