Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Tom Gundersen
On Sat, Dec 21, 2013 at 11:22 AM, Thomas Bächler tho...@archlinux.org wrote:
 This fixes a regression introduced in 64e70e4 where the mount fails
 when fstab is misconfigured with fs_passno  0 on a virtual file
 system like tmpfs.
 ---
  src/fstab-generator/fstab-generator.c | 8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)

 diff --git a/src/fstab-generator/fstab-generator.c 
 b/src/fstab-generator/fstab-generator.c
 index 1227f08..709a1c3 100644
 --- a/src/fstab-generator/fstab-generator.c
 +++ b/src/fstab-generator/fstab-generator.c
 @@ -255,9 +255,11 @@ static int add_mount(
  Before=%s\n,
  post);

 -r = add_fsck(f, what, where, type, passno);
 -if (r  0)
 -return r;
 +if(is_device_path(what)) {
 +r = add_fsck(f, what, where, type, passno);
 +if (r  0)
 +return r;
 +}

  fprintf(f,
  \n

How does fsck -A deal with these cases?

Also, how does your patch deal with LABEL= and UUDI=?

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Dave Reisner
On Sat, Dec 21, 2013 at 12:49:07PM +0100, Tom Gundersen wrote:
 On Sat, Dec 21, 2013 at 11:22 AM, Thomas Bächler tho...@archlinux.org wrote:
  This fixes a regression introduced in 64e70e4 where the mount fails
  when fstab is misconfigured with fs_passno  0 on a virtual file
  system like tmpfs.
  ---
   src/fstab-generator/fstab-generator.c | 8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)
 
  diff --git a/src/fstab-generator/fstab-generator.c 
  b/src/fstab-generator/fstab-generator.c
  index 1227f08..709a1c3 100644
  --- a/src/fstab-generator/fstab-generator.c
  +++ b/src/fstab-generator/fstab-generator.c
  @@ -255,9 +255,11 @@ static int add_mount(
   Before=%s\n,
   post);
 
  -r = add_fsck(f, what, where, type, passno);
  -if (r  0)
  -return r;
  +if(is_device_path(what)) {
  +r = add_fsck(f, what, where, type, passno);
  +if (r  0)
  +return r;
  +}
 
   fprintf(f,
   \n
 
 How does fsck -A deal with these cases?

tmpfs falls into the category of pseudofs, which fsck -A will
intentionally ignore, regardless of the passno.

 Also, how does your patch deal with LABEL= and UUDI=?

At this point, what has been filtered through fstab_node_to_udev_node,
so LABEL=foo will be /dev/disk/by-label/foo.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Kay Sievers
On Sat, Dec 21, 2013 at 5:33 PM, Dave Reisner d...@falconindy.com wrote:
 On Sat, Dec 21, 2013 at 12:49:07PM +0100, Tom Gundersen wrote:
 On Sat, Dec 21, 2013 at 11:22 AM, Thomas Bächler tho...@archlinux.org 
 wrote:
  This fixes a regression introduced in 64e70e4 where the mount fails
  when fstab is misconfigured with fs_passno  0 on a virtual file
  system like tmpfs.
  ---
   src/fstab-generator/fstab-generator.c | 8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)
 
  diff --git a/src/fstab-generator/fstab-generator.c 
  b/src/fstab-generator/fstab-generator.c
  index 1227f08..709a1c3 100644
  --- a/src/fstab-generator/fstab-generator.c
  +++ b/src/fstab-generator/fstab-generator.c
  @@ -255,9 +255,11 @@ static int add_mount(
   Before=%s\n,
   post);
 
  -r = add_fsck(f, what, where, type, passno);
  -if (r  0)
  -return r;
  +if(is_device_path(what)) {
  +r = add_fsck(f, what, where, type, passno);
  +if (r  0)
  +return r;
  +}
 
   fprintf(f,
   \n

 How does fsck -A deal with these cases?

 tmpfs falls into the category of pseudofs, which fsck -A will
 intentionally ignore, regardless of the passno.

 Also, how does your patch deal with LABEL= and UUDI=?

 At this point, what has been filtered through fstab_node_to_udev_node,
 so LABEL=foo will be /dev/disk/by-label/foo.

Generally, not sure if that it always correct here, kernel nodev
superblocks have a dev_t with major == 0 and are very simple to detect
that way.

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Tom Gundersen
On Sat, Dec 21, 2013 at 5:42 PM, Kay Sievers k...@vrfy.org wrote:
 On Sat, Dec 21, 2013 at 5:33 PM, Dave Reisner d...@falconindy.com wrote:
 On Sat, Dec 21, 2013 at 12:49:07PM +0100, Tom Gundersen wrote:
 On Sat, Dec 21, 2013 at 11:22 AM, Thomas Bächler tho...@archlinux.org 
 wrote:
  This fixes a regression introduced in 64e70e4 where the mount fails
  when fstab is misconfigured with fs_passno  0 on a virtual file
  system like tmpfs.
  ---
   src/fstab-generator/fstab-generator.c | 8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)
 
  diff --git a/src/fstab-generator/fstab-generator.c 
  b/src/fstab-generator/fstab-generator.c
  index 1227f08..709a1c3 100644
  --- a/src/fstab-generator/fstab-generator.c
  +++ b/src/fstab-generator/fstab-generator.c
  @@ -255,9 +255,11 @@ static int add_mount(
   Before=%s\n,
   post);
 
  -r = add_fsck(f, what, where, type, passno);
  -if (r  0)
  -return r;
  +if(is_device_path(what)) {
  +r = add_fsck(f, what, where, type, passno);
  +if (r  0)
  +return r;
  +}
 
   fprintf(f,
   \n

 How does fsck -A deal with these cases?

 tmpfs falls into the category of pseudofs, which fsck -A will
 intentionally ignore, regardless of the passno.

 Also, how does your patch deal with LABEL= and UUDI=?

 At this point, what has been filtered through fstab_node_to_udev_node,
 so LABEL=foo will be /dev/disk/by-label/foo.

 Generally, not sure if that it always correct here, kernel nodev
 superblocks have a dev_t with major == 0 and are very simple to detect
 that way.

Hm, so why doesn't fsck just deal gracefully with this?

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Thomas Bächler
Am 21.12.2013 12:49, schrieb Tom Gundersen:
 -r = add_fsck(f, what, where, type, passno);
 -if (r  0)
 -return r;
 +if(is_device_path(what)) {
 +r = add_fsck(f, what, where, type, passno);
 +if (r  0)
 +return r;
 +}

  fprintf(f,
  \n
 Also, how does your patch deal with LABEL= and UUDI=?

This patch mirrors the old behaviour of the (now removed) FsckPassNo
code path.




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: Do not try to fsck non-devices

2013-12-21 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Dec 21, 2013 at 05:49:19PM +0100, Tom Gundersen wrote:
 On Sat, Dec 21, 2013 at 5:42 PM, Kay Sievers k...@vrfy.org wrote:
  On Sat, Dec 21, 2013 at 5:33 PM, Dave Reisner d...@falconindy.com wrote:
  On Sat, Dec 21, 2013 at 12:49:07PM +0100, Tom Gundersen wrote:
  On Sat, Dec 21, 2013 at 11:22 AM, Thomas Bächler tho...@archlinux.org 
  wrote:
   This fixes a regression introduced in 64e70e4 where the mount fails
   when fstab is misconfigured with fs_passno  0 on a virtual file
   system like tmpfs.
   ---
src/fstab-generator/fstab-generator.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
  
   diff --git a/src/fstab-generator/fstab-generator.c 
   b/src/fstab-generator/fstab-generator.c
   index 1227f08..709a1c3 100644
   --- a/src/fstab-generator/fstab-generator.c
   +++ b/src/fstab-generator/fstab-generator.c
   @@ -255,9 +255,11 @@ static int add_mount(
Before=%s\n,
post);
  
   -r = add_fsck(f, what, where, type, passno);
   -if (r  0)
   -return r;
   +if(is_device_path(what)) {
   +r = add_fsck(f, what, where, type, passno);
   +if (r  0)
   +return r;
   +}
Hi,
patch is applied, but I moved the chck into add_fsck, because the check
for passno is there. And I added a warning, since this is a configuration
error that should be corrected.

Also, I don't see how the mount could fail for tmpfs: tmpfs must always
be specified as the type, and if the type is specified, add_fsck
looks for /sbin/fsck.type and only emits a warning. But in case of
a non-device fs which can be given with auto as the type, e.g. nfs,
there indeed was a problem.

  How does fsck -A deal with these cases?
 
  tmpfs falls into the category of pseudofs, which fsck -A will
  intentionally ignore, regardless of the passno.
 
  Also, how does your patch deal with LABEL= and UUDI=?
 
  At this point, what has been filtered through fstab_node_to_udev_node,
  so LABEL=foo will be /dev/disk/by-label/foo.
 
  Generally, not sure if that it always correct here, kernel nodev
  superblocks have a dev_t with major == 0 and are very simple to detect
  that way.
There's no superblock yet at this point, because the device might not be there
yet. But I think that the is_device_path test is OK.

 Hm, so why doesn't fsck just deal gracefully with this?
We call /sbin/fsck.type directly, which in this case doesn't exist. Also
systemd waits for the device to appear before calling fsck.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel