fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ
@ 2020-10-29  4:03 Palmer Dabbelt
  2020-10-29  9:56 ` Amir Goldstein
  2020-11-09 22:45 ` Dave Chinner
  0 siblings, 2 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2020-10-29  4:03 UTC (permalink / raw)
  To: fstests; +Cc: Palmer Dabbelt

When I compile this normally I end up with the definition of
MAX_HANDLE_SZ, but when I compile it in a minimal buildroot-based
environment I don't.  I'm not sure where this is supposed to come from,
but as of 3f4760c2 ("open_by_handle: add option -z to query file handle
size") it appears to be unnecessary.

Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
---
I haven't actually run this, as I haven't figured out how to yet.  It
does build, though.
---
 src/open_by_handle.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/open_by_handle.c b/src/open_by_handle.c
index 0f74ed08..ddeffb7a 100644
--- a/src/open_by_handle.c
+++ b/src/open_by_handle.c
@@ -92,7 +92,6 @@ Examples:
 
 struct handle {
 	struct file_handle fh;
-	unsigned char fid[MAX_HANDLE_SZ];
 } handle[MAXFILES], dir_handle;
 
 void usage(void)
-- 
2.29.1.341.ge80a0c044ae-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ
  2020-10-29  4:03 [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ Palmer Dabbelt
@ 2020-10-29  9:56 ` Amir Goldstein
  2020-11-09 22:45 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2020-10-29  9:56 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: fstests

On Thu, Oct 29, 2020 at 11:01 AM Palmer Dabbelt
<palmerdabbelt@google.com> wrote:
>
> When I compile this normally I end up with the definition of
> MAX_HANDLE_SZ, but when I compile it in a minimal buildroot-based
> environment I don't.  I'm not sure where this is supposed to come from,
> but as of 3f4760c2 ("open_by_handle: add option -z to query file handle
> size") it appears to be unnecessary.
>
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> ---
> I haven't actually run this, as I haven't figured out how to yet.  It
> does build, though.
> ---
>  src/open_by_handle.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/open_by_handle.c b/src/open_by_handle.c
> index 0f74ed08..ddeffb7a 100644
> --- a/src/open_by_handle.c
> +++ b/src/open_by_handle.c
> @@ -92,7 +92,6 @@ Examples:
>
>  struct handle {
>         struct file_handle fh;
> -       unsigned char fid[MAX_HANDLE_SZ];
>  } handle[MAXFILES], dir_handle;

This is absolutely wrong!

I don't know what's the best way to fix the build error,
but this fid member is absolutely needed.

For all I care, you can define MAX_TEST_HANDLE_SZ to 128 or to
MAX_HANDLE_SZ if it is defined.

The test doesn't really care what the value of MAX_HANDLE_SZ is.
It just needs to be large enough to accomodate for the size of file handles
of the tested filesystem.

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ
  2020-10-29  4:03 [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ Palmer Dabbelt
  2020-10-29  9:56 ` Amir Goldstein
@ 2020-11-09 22:45 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2020-11-09 22:45 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: fstests

On Wed, Oct 28, 2020 at 09:03:39PM -0700, Palmer Dabbelt wrote:
> When I compile this normally I end up with the definition of
> MAX_HANDLE_SZ, but when I compile it in a minimal buildroot-based
> environment I don't.  I'm not sure where this is supposed to come from,
> but as of 3f4760c2 ("open_by_handle: add option -z to query file handle
> size") it appears to be unnecessary.

Hmmm - it should be trivial to find where it comes from with grep:

$ grep -R MAX_HANDLE_SZ /usr/include
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:# define	MAX_HANDLE_SZ	128
$

IOWs, MAX_HANDLE_SZ is defined via:

#include <fcntl.h>

which src/open_by_handle.c already includes.

IOWs, this looks like a problem with your build root environment not
defining MAX_HANDLE_SZ correctly, not a problem with fstests.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09 23:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29  4:03 [PATCH] open_by_handle: Don't use MAX_HANDLE_SZ Palmer Dabbelt
2020-10-29  9:56 ` Amir Goldstein
2020-11-09 22:45 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).