diff mbox

libquota: Do not build libquota when disabled

Message ID 1326213996-13759-1-git-send-email-jack@suse.cz
State Rejected, archived
Headers show

Commit Message

Jan Kara Jan. 10, 2012, 4:46 p.m. UTC
Due to missing QUOTA_CMT definition in configure.in, libquota was built
(and e.g. include file was installed) even when quota support was disabled.
Fix it. Also fix help text of the configure option when we are at it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 configure    |   11 ++++++-----
 configure.in |    4 +++-
 2 files changed, 9 insertions(+), 6 deletions(-)

Comments

Jan Kara Jan. 10, 2012, 7:38 p.m. UTC | #1
On Tue 10-01-12 17:46:36, Jan Kara wrote:
> Due to missing QUOTA_CMT definition in configure.in, libquota was built
> (and e.g. include file was installed) even when quota support was disabled.
> Fix it. Also fix help text of the configure option when we are at it.
  Hum, but after this e2fsck does not compile because of missing
libquota.a. So should it be possible to disable quota support (and thus
e2fsck should be fixed) or not (and then config option should be removed)?

Also I've also noticed that libquota is generated as a static library even
if --enable-elf-shlibs is specified. Bug? Or is libquota supposed to be
internal library of e2fsprogs and never used outside of e2fsprogs? But then
why is it and its header files installed?

BTW, since the library is tied to ext4 anyway, won't it be more logical for
external developpers to make it part of libext2fs?

								Honza
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  configure    |   11 ++++++-----
>  configure.in |    4 +++-
>  2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/configure b/configure
> index 9f5eeb5..965f7cf 100755
> --- a/configure
> +++ b/configure
> @@ -1462,7 +1462,7 @@ Optional Features:
>    --disable-testio-debug  disable the use of the test I/O manager for debugging
>    --disable-libuuid	  do not build private uuid library
>    --disable-libblkid	  do not build private blkid library
> -  --enable-libquota	  enable quota support
> +  --enable-quota	  enable quota support
>    --disable-debugfs   	  disable support of debugfs program
>    --disable-imager   	  disable support of e2image program
>    --disable-resizer   	  disable support of e2resize program
> @@ -5209,11 +5209,13 @@ fi
>  if test "${enable_quota+set}" = set; then :
>    enableval=$enable_quota; if test "$enableval" = "no"
>  then
> +	QUOTA_CMT="#"
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
>  $as_echo "Disabling quota support" >&6; }
>  else
>  	$as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
>  
> +	QUOTA_CMT=""
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
>  $as_echo "Enabling quota support" >&6; }
>  fi
> @@ -7127,7 +7129,6 @@ int
>  main ()
>  {
>    char *data, *data2, *data3;
> -  const char *cdata2;
>    int i, pagesize;
>    int fd, fd2;
>  
> @@ -7152,10 +7153,10 @@ main ()
>    fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
>    if (fd2 < 0)
>      return 4;
> -  cdata2 = "";
> -  if (write (fd2, cdata2, 1) != 1)
> +  data2 = "";
> +  if (write (fd2, data2, 1) != 1)
>      return 5;
> -  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
> +  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
>    if (data2 == MAP_FAILED)
>      return 6;
>    for (i = 0; i < pagesize; ++i)
> diff --git a/configure.in b/configure.in
> index c304a8d..94e7c21 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -531,12 +531,14 @@ dnl
>  PKG_PROG_PKG_CONFIG
>  AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
>  AC_ARG_ENABLE([quota],
> -[  --enable-libquota	  enable quota support],
> +[  --enable-quota	  enable quota support],
>  if test "$enableval" = "no"
>  then
> +	QUOTA_CMT="#"
>  	AC_MSG_RESULT([Disabling quota support])
>  else
>  	AC_DEFINE(CONFIG_QUOTA, 1)
> +	QUOTA_CMT=""
>  	AC_MSG_RESULT([Enabling quota support])
>  fi
>  ,
> -- 
> 1.7.1
>
Aditya Kali Jan. 10, 2012, 9:50 p.m. UTC | #2
Libquota is supposed to be internal library of e2fsprogs. Initially I
added the code thinking that it would be an independent library, but
it depends too much on libext2fs and should be part of libext2fs
itself. The quota header files should not be installed.

Also, e2fsck should compile even without quota support. This needs to be fixed.

Thanks,
Aditya

On Tue, Jan 10, 2012 at 11:38 AM, Jan Kara <jack@suse.cz> wrote:
> On Tue 10-01-12 17:46:36, Jan Kara wrote:
>> Due to missing QUOTA_CMT definition in configure.in, libquota was built
>> (and e.g. include file was installed) even when quota support was disabled.
>> Fix it. Also fix help text of the configure option when we are at it.
>  Hum, but after this e2fsck does not compile because of missing
> libquota.a. So should it be possible to disable quota support (and thus
> e2fsck should be fixed) or not (and then config option should be removed)?
>
> Also I've also noticed that libquota is generated as a static library even
> if --enable-elf-shlibs is specified. Bug? Or is libquota supposed to be
> internal library of e2fsprogs and never used outside of e2fsprogs? But then
> why is it and its header files installed?
>
> BTW, since the library is tied to ext4 anyway, won't it be more logical for
> external developpers to make it part of libext2fs?
>
>                                                                Honza
>>
>> Signed-off-by: Jan Kara <jack@suse.cz>
>> ---
>>  configure    |   11 ++++++-----
>>  configure.in |    4 +++-
>>  2 files changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 9f5eeb5..965f7cf 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1462,7 +1462,7 @@ Optional Features:
>>    --disable-testio-debug  disable the use of the test I/O manager for debugging
>>    --disable-libuuid    do not build private uuid library
>>    --disable-libblkid   do not build private blkid library
>> -  --enable-libquota    enable quota support
>> +  --enable-quota       enable quota support
>>    --disable-debugfs            disable support of debugfs program
>>    --disable-imager             disable support of e2image program
>>    --disable-resizer            disable support of e2resize program
>> @@ -5209,11 +5209,13 @@ fi
>>  if test "${enable_quota+set}" = set; then :
>>    enableval=$enable_quota; if test "$enableval" = "no"
>>  then
>> +     QUOTA_CMT="#"
>>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
>>  $as_echo "Disabling quota support" >&6; }
>>  else
>>       $as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
>>
>> +     QUOTA_CMT=""
>>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
>>  $as_echo "Enabling quota support" >&6; }
>>  fi
>> @@ -7127,7 +7129,6 @@ int
>>  main ()
>>  {
>>    char *data, *data2, *data3;
>> -  const char *cdata2;
>>    int i, pagesize;
>>    int fd, fd2;
>>
>> @@ -7152,10 +7153,10 @@ main ()
>>    fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
>>    if (fd2 < 0)
>>      return 4;
>> -  cdata2 = "";
>> -  if (write (fd2, cdata2, 1) != 1)
>> +  data2 = "";
>> +  if (write (fd2, data2, 1) != 1)
>>      return 5;
>> -  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
>> +  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
>>    if (data2 == MAP_FAILED)
>>      return 6;
>>    for (i = 0; i < pagesize; ++i)
>> diff --git a/configure.in b/configure.in
>> index c304a8d..94e7c21 100644
>> --- a/configure.in
>> +++ b/configure.in
>> @@ -531,12 +531,14 @@ dnl
>>  PKG_PROG_PKG_CONFIG
>>  AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
>>  AC_ARG_ENABLE([quota],
>> -[  --enable-libquota   enable quota support],
>> +[  --enable-quota      enable quota support],
>>  if test "$enableval" = "no"
>>  then
>> +     QUOTA_CMT="#"
>>       AC_MSG_RESULT([Disabling quota support])
>>  else
>>       AC_DEFINE(CONFIG_QUOTA, 1)
>> +     QUOTA_CMT=""
>>       AC_MSG_RESULT([Enabling quota support])
>>  fi
>>  ,
>> --
>> 1.7.1
>>
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Kara Jan. 11, 2012, 12:13 a.m. UTC | #3
On Tue 10-01-12 13:50:06, Aditya Kali wrote:
> Libquota is supposed to be internal library of e2fsprogs. Initially I
> added the code thinking that it would be an independent library, but
> it depends too much on libext2fs and should be part of libext2fs
> itself. The quota header files should not be installed.
  Thanks for clarification! Do you plan to work on fixing this or should I
have a look at it?

> Also, e2fsck should compile even without quota support. This needs to be
> fixed.
  Hum, but why would anyone want to compile e2fsprogs without quota
support? We also don't provide a way to switch off for example indexed
directories support. So why would be quota different?

								Honza

> On Tue, Jan 10, 2012 at 11:38 AM, Jan Kara <jack@suse.cz> wrote:
> > On Tue 10-01-12 17:46:36, Jan Kara wrote:
> >> Due to missing QUOTA_CMT definition in configure.in, libquota was built
> >> (and e.g. include file was installed) even when quota support was disabled.
> >> Fix it. Also fix help text of the configure option when we are at it.
> >  Hum, but after this e2fsck does not compile because of missing
> > libquota.a. So should it be possible to disable quota support (and thus
> > e2fsck should be fixed) or not (and then config option should be removed)?
> >
> > Also I've also noticed that libquota is generated as a static library even
> > if --enable-elf-shlibs is specified. Bug? Or is libquota supposed to be
> > internal library of e2fsprogs and never used outside of e2fsprogs? But then
> > why is it and its header files installed?
> >
> > BTW, since the library is tied to ext4 anyway, won't it be more logical for
> > external developpers to make it part of libext2fs?
> >
> >                                                                Honza
> >>
> >> Signed-off-by: Jan Kara <jack@suse.cz>
> >> ---
> >>  configure    |   11 ++++++-----
> >>  configure.in |    4 +++-
> >>  2 files changed, 9 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/configure b/configure
> >> index 9f5eeb5..965f7cf 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -1462,7 +1462,7 @@ Optional Features:
> >>    --disable-testio-debug  disable the use of the test I/O manager for debugging
> >>    --disable-libuuid    do not build private uuid library
> >>    --disable-libblkid   do not build private blkid library
> >> -  --enable-libquota    enable quota support
> >> +  --enable-quota       enable quota support
> >>    --disable-debugfs            disable support of debugfs program
> >>    --disable-imager             disable support of e2image program
> >>    --disable-resizer            disable support of e2resize program
> >> @@ -5209,11 +5209,13 @@ fi
> >>  if test "${enable_quota+set}" = set; then :
> >>    enableval=$enable_quota; if test "$enableval" = "no"
> >>  then
> >> +     QUOTA_CMT="#"
> >>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
> >>  $as_echo "Disabling quota support" >&6; }
> >>  else
> >>       $as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
> >>
> >> +     QUOTA_CMT=""
> >>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
> >>  $as_echo "Enabling quota support" >&6; }
> >>  fi
> >> @@ -7127,7 +7129,6 @@ int
> >>  main ()
> >>  {
> >>    char *data, *data2, *data3;
> >> -  const char *cdata2;
> >>    int i, pagesize;
> >>    int fd, fd2;
> >>
> >> @@ -7152,10 +7153,10 @@ main ()
> >>    fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
> >>    if (fd2 < 0)
> >>      return 4;
> >> -  cdata2 = "";
> >> -  if (write (fd2, cdata2, 1) != 1)
> >> +  data2 = "";
> >> +  if (write (fd2, data2, 1) != 1)
> >>      return 5;
> >> -  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
> >> +  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
> >>    if (data2 == MAP_FAILED)
> >>      return 6;
> >>    for (i = 0; i < pagesize; ++i)
> >> diff --git a/configure.in b/configure.in
> >> index c304a8d..94e7c21 100644
> >> --- a/configure.in
> >> +++ b/configure.in
> >> @@ -531,12 +531,14 @@ dnl
> >>  PKG_PROG_PKG_CONFIG
> >>  AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
> >>  AC_ARG_ENABLE([quota],
> >> -[  --enable-libquota   enable quota support],
> >> +[  --enable-quota      enable quota support],
> >>  if test "$enableval" = "no"
> >>  then
> >> +     QUOTA_CMT="#"
> >>       AC_MSG_RESULT([Disabling quota support])
> >>  else
> >>       AC_DEFINE(CONFIG_QUOTA, 1)
> >> +     QUOTA_CMT=""
> >>       AC_MSG_RESULT([Enabling quota support])
> >>  fi
> >>  ,
> >> --
> >> 1.7.1
> >>
> > --
> > Jan Kara <jack@suse.cz>
> > SUSE Labs, CR
Aditya Kali Jan. 11, 2012, 6:58 p.m. UTC | #4
On Tue, Jan 10, 2012 at 4:13 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 10-01-12 13:50:06, Aditya Kali wrote:
>> Libquota is supposed to be internal library of e2fsprogs. Initially I
>> added the code thinking that it would be an independent library, but
>> it depends too much on libext2fs and should be part of libext2fs
>> itself. The quota header files should not be installed.
>  Thanks for clarification! Do you plan to work on fixing this or should I
> have a look at it?
>
I have planned to work on fixing this. But I wasn't able to give time
for quota stuff recently. I will try to look at this asap.

>> Also, e2fsck should compile even without quota support. This needs to be
>> fixed.
>  Hum, but why would anyone want to compile e2fsprogs without quota
> support? We also don't provide a way to switch off for example indexed
> directories support. So why would be quota different?
>
The quota support isn't fully baked-in yet. There are still some
e2fsck changes needed (currently, we simply recreate quota files after
e2fsck and do not check if the previous quota information was correct
or not). Also, the kernel side changes are not yet accepted. Since
this code has not been tested much, it would be better for people to
have an option to exclude it out. That was the reasoning behind adding
that option. Eventually we might want to remove it though.

Thanks,
--
Aditya

>                                                                Honza
>
>> On Tue, Jan 10, 2012 at 11:38 AM, Jan Kara <jack@suse.cz> wrote:
>> > On Tue 10-01-12 17:46:36, Jan Kara wrote:
>> >> Due to missing QUOTA_CMT definition in configure.in, libquota was built
>> >> (and e.g. include file was installed) even when quota support was disabled.
>> >> Fix it. Also fix help text of the configure option when we are at it.
>> >  Hum, but after this e2fsck does not compile because of missing
>> > libquota.a. So should it be possible to disable quota support (and thus
>> > e2fsck should be fixed) or not (and then config option should be removed)?
>> >
>> > Also I've also noticed that libquota is generated as a static library even
>> > if --enable-elf-shlibs is specified. Bug? Or is libquota supposed to be
>> > internal library of e2fsprogs and never used outside of e2fsprogs? But then
>> > why is it and its header files installed?
>> >
>> > BTW, since the library is tied to ext4 anyway, won't it be more logical for
>> > external developpers to make it part of libext2fs?
>> >
>> >                                                                Honza
>> >>
>> >> Signed-off-by: Jan Kara <jack@suse.cz>
>> >> ---
>> >>  configure    |   11 ++++++-----
>> >>  configure.in |    4 +++-
>> >>  2 files changed, 9 insertions(+), 6 deletions(-)
>> >>
>> >> diff --git a/configure b/configure
>> >> index 9f5eeb5..965f7cf 100755
>> >> --- a/configure
>> >> +++ b/configure
>> >> @@ -1462,7 +1462,7 @@ Optional Features:
>> >>    --disable-testio-debug  disable the use of the test I/O manager for debugging
>> >>    --disable-libuuid    do not build private uuid library
>> >>    --disable-libblkid   do not build private blkid library
>> >> -  --enable-libquota    enable quota support
>> >> +  --enable-quota       enable quota support
>> >>    --disable-debugfs            disable support of debugfs program
>> >>    --disable-imager             disable support of e2image program
>> >>    --disable-resizer            disable support of e2resize program
>> >> @@ -5209,11 +5209,13 @@ fi
>> >>  if test "${enable_quota+set}" = set; then :
>> >>    enableval=$enable_quota; if test "$enableval" = "no"
>> >>  then
>> >> +     QUOTA_CMT="#"
>> >>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
>> >>  $as_echo "Disabling quota support" >&6; }
>> >>  else
>> >>       $as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
>> >>
>> >> +     QUOTA_CMT=""
>> >>       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
>> >>  $as_echo "Enabling quota support" >&6; }
>> >>  fi
>> >> @@ -7127,7 +7129,6 @@ int
>> >>  main ()
>> >>  {
>> >>    char *data, *data2, *data3;
>> >> -  const char *cdata2;
>> >>    int i, pagesize;
>> >>    int fd, fd2;
>> >>
>> >> @@ -7152,10 +7153,10 @@ main ()
>> >>    fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
>> >>    if (fd2 < 0)
>> >>      return 4;
>> >> -  cdata2 = "";
>> >> -  if (write (fd2, cdata2, 1) != 1)
>> >> +  data2 = "";
>> >> +  if (write (fd2, data2, 1) != 1)
>> >>      return 5;
>> >> -  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
>> >> +  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
>> >>    if (data2 == MAP_FAILED)
>> >>      return 6;
>> >>    for (i = 0; i < pagesize; ++i)
>> >> diff --git a/configure.in b/configure.in
>> >> index c304a8d..94e7c21 100644
>> >> --- a/configure.in
>> >> +++ b/configure.in
>> >> @@ -531,12 +531,14 @@ dnl
>> >>  PKG_PROG_PKG_CONFIG
>> >>  AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
>> >>  AC_ARG_ENABLE([quota],
>> >> -[  --enable-libquota   enable quota support],
>> >> +[  --enable-quota      enable quota support],
>> >>  if test "$enableval" = "no"
>> >>  then
>> >> +     QUOTA_CMT="#"
>> >>       AC_MSG_RESULT([Disabling quota support])
>> >>  else
>> >>       AC_DEFINE(CONFIG_QUOTA, 1)
>> >> +     QUOTA_CMT=""
>> >>       AC_MSG_RESULT([Enabling quota support])
>> >>  fi
>> >>  ,
>> >> --
>> >> 1.7.1
>> >>
>> > --
>> > Jan Kara <jack@suse.cz>
>> > SUSE Labs, CR
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/configure b/configure
index 9f5eeb5..965f7cf 100755
--- a/configure
+++ b/configure
@@ -1462,7 +1462,7 @@  Optional Features:
   --disable-testio-debug  disable the use of the test I/O manager for debugging
   --disable-libuuid	  do not build private uuid library
   --disable-libblkid	  do not build private blkid library
-  --enable-libquota	  enable quota support
+  --enable-quota	  enable quota support
   --disable-debugfs   	  disable support of debugfs program
   --disable-imager   	  disable support of e2image program
   --disable-resizer   	  disable support of e2resize program
@@ -5209,11 +5209,13 @@  fi
 if test "${enable_quota+set}" = set; then :
   enableval=$enable_quota; if test "$enableval" = "no"
 then
+	QUOTA_CMT="#"
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
 $as_echo "Disabling quota support" >&6; }
 else
 	$as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
 
+	QUOTA_CMT=""
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
 $as_echo "Enabling quota support" >&6; }
 fi
@@ -7127,7 +7129,6 @@  int
 main ()
 {
   char *data, *data2, *data3;
-  const char *cdata2;
   int i, pagesize;
   int fd, fd2;
 
@@ -7152,10 +7153,10 @@  main ()
   fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
   if (fd2 < 0)
     return 4;
-  cdata2 = "";
-  if (write (fd2, cdata2, 1) != 1)
+  data2 = "";
+  if (write (fd2, data2, 1) != 1)
     return 5;
-  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
   if (data2 == MAP_FAILED)
     return 6;
   for (i = 0; i < pagesize; ++i)
diff --git a/configure.in b/configure.in
index c304a8d..94e7c21 100644
--- a/configure.in
+++ b/configure.in
@@ -531,12 +531,14 @@  dnl
 PKG_PROG_PKG_CONFIG
 AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
 AC_ARG_ENABLE([quota],
-[  --enable-libquota	  enable quota support],
+[  --enable-quota	  enable quota support],
 if test "$enableval" = "no"
 then
+	QUOTA_CMT="#"
 	AC_MSG_RESULT([Disabling quota support])
 else
 	AC_DEFINE(CONFIG_QUOTA, 1)
+	QUOTA_CMT=""
 	AC_MSG_RESULT([Enabling quota support])
 fi
 ,