]> git.pld-linux.org Git - packages/autofs.git/blob - autofs-4.1.3-strict.patch
- up to 4.1.4
[packages/autofs.git] / autofs-4.1.3-strict.patch
1
2 Problem: infinite error loop occurs when trying to access non-exitent
3          directory.
4
5 This patch, for 4.1.3, fixes the problem caused when the default for
6 multi-mounts was changed from strict to non-strict. This change tickled
7 a bug in the old autofs4 kernel module found in 2.4 kernels and 2.6
8 kernels to date (ie. < 2.6.7).
9
10 This change in default caused a small change in mount logic which went
11 unnoticed and lead to this problem. So the kernel interaction problem
12 remains but is much less likely to occur. If this problem persists
13 after applying this patch then update your kernel autofs4.
14
15 The patch restores the previous logic but leaves the new default.
16
17 diff -Nur autofs-4.1.3.orig/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
18 --- autofs-4.1.3.orig/modules/parse_sun.c       2004-05-18 20:22:40.000000000 +0800
19 +++ autofs-4.1.3/modules/parse_sun.c    2004-05-29 15:38:42.000000000 +0800
20 @@ -602,10 +602,8 @@
21                               options);
22         }
23  
24 -       if (nonstrict && rv) {
25 -               debug("ignoring failure of non-strict mount");
26 -               return 0;
27 -       }
28 +       if (nonstrict && rv)
29 +               return -rv;
30  
31         return rv;
32  }
33 @@ -746,7 +744,11 @@
34                         free(loc);
35                         free(myoptions);
36  
37 -                       if (rv)
38 +                       /* Convert non-strict failure into success */
39 +                       if (rv < 0) {
40 +                               rv = 0;
41 +                               debug("parse_mount: ignoring failure of non-strict mount");
42 +                       } else if (rv > 0)
43                                 break;
44  
45                 } while (*p == '/');
46 @@ -789,6 +791,10 @@
47                       options, loclen, loc);
48  
49                 rv = sun_mount(root, name, name_len, loc, loclen, options);
50 +               /* non-strict failure to normal failure for ordinary mount */
51 +               if (rv < 0)
52 +                       rv = -rv;
53 +                       
54                 free(loc);
55                 free(options);
56         }
This page took 0.026674 seconds and 3 git commands to generate.