Aurélien Aptel <aaptel@xxxxxxxx> writes: > I would put in the commit msg that this requires recent kernel. Agreed. > We should probably merge kernel code first so we can reference it here > in the commit msg, and say in the man page when did the kernel change. Agreed. > There can be cases where cifs-utils is more recent than kernel and > mount.cifs will pass all the ip instead of trying them before passing > the good one to the kernel but since it's an old kernel it won't try > them all. Good point! Yes, we should handle both cases. > We could add an option to enable new behavior or check the kernel > version from within mount.cifs.. thoughts? I don't like the idea of checking the version because the running kernel might not have the expected patches. Perhaps a new option would be better... I'll think more about it. > Paulo Alcantara <pc@xxxxxx> writes: >> >> +static void set_ip_params(char *options, size_t options_size, char *addrlist) >> +{ >> + char *s = addrlist + strlen(addrlist), *q = s; >> + char tmp; >> + >> + do { >> + for (; s >= addrlist && *s != ','; s--); >> + tmp = *q; >> + *q = '\0'; >> + strlcat(options, *options ? ",ip=" : "ip=", options_size); >> + strlcat(options, s + 1, options_size); >> + *q = tmp; >> + } while (q = s--, s >= addrlist); >> +} > > I think you should write this in a clearer way and comment, this is hard > to read. That's horrible, indeed. I'll definitely make it readable in next version. > I was going to say should we return errors if we truncate the ips, but > none of the mount.cifs.c code checks for truncation so I guess we can > ignore. IIRC, yes.