Skip to contentSkip to conversation

5.0.0_beta1: infinite loop on read error

BUG Denys Vlasenko 2 participants 2 messages Sep 26, 2007 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Hi Ian,

I was using automount 4.1.4 for many years now, and I run it like this:

automount -f -s -v --timeout 15 /.local/mnt/auto program /root/bin/mapper.sh

This is a valid syntax for 4.1.4, but 5.0.0 doesn't like it, and it doesn't error out cleanly too.

It goes into infinite loop, eating 100% CPU and killable only with SIGKILL. As it turns out, it opens /.local/mnt/auto and reads it, and gets EISDIR, and ... retries, retries, retries forever. Here:

modules/lookup_file.c

        f = fopen(ctxt->mapname, "r");
 ...
        master_init_scan();
        while(1) {
                entry = read_one(f, path, ent);
                if (!entry) {
                        if (feof(f)) <===== doesnt check ferror()
                                break;
                        continue;
                }

Please fix.
--
vda

maintainer
#1 lore raw
Quoted 4 lines · Denys Vlasenko

Hi Ian,

I was using automount 4.1.4 for many years now, and I run it like this:

Quoted 8 lines

automount -f -s -v --timeout 15 /.local/mnt/auto program /root/bin/mapper.sh

This is a valid syntax for 4.1.4, but 5.0.0 doesn't like it, and it doesn't error out cleanly too.

It goes into infinite loop, eating 100% CPU and killable only with SIGKILL. As it turns out, it opens /.local/mnt/auto and reads it, and gets EISDIR, and ... retries, retries, retries forever. Here:

Ooops, I'll fix that.
Thanks