[systemd-devel] [PATCH 1/9] fsckd daemon for inter-fsckd communication
Didier Roche
didrocks at ubuntu.com
Tue Feb 17 08:25:54 PST 2015
Le 14/02/2015 17:21, Zbigniew Jędrzejewski-Szmek a écrit :
Thanks for the review, reattached the patch with those fixes.
> On Thu, Feb 05, 2015 at 06:06:50PM +0100, Didier Roche wrote:
> + if (fsckd_fd < 0) {
> + log_warning_errno(errno, "Cannot open fsckd socket, we won't report fsck progress: %m");
> + return -errno;
> + }
> + if (connect(fsckd_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) {
> + log_warning_errno(errno, "Cannot connect to fsckd socket, we won't report fsck progress: %m");
> + return -errno;
> Use 'return log_warning_errno(...)'.
>
>> + }
>>
>> f = fdopen(fd, "r");
>> if (!f) {
>> - safe_close(fd);
>> + log_warning_errno(errno, "Cannot connect to fsck, we won't report fsck progress: %m");
>> return -errno;
>> }
Also changed it on this last one below, thanks!
>>
>>
>> +
>> + /* ensure we have enough data to read */
>> + r = ioctl(fd, FIONREAD, &buflen);
>> + if (r == 0 && buflen != 0 && (size_t) buflen < sizeof(FsckProgress)) {
>> + if (client->buflen != buflen)
>> + client->buflen = buflen;
>> + /* we got twice the same size from a bad behaving client, kick it off the list */
>> + else {
> Shouldn't this be logged? Seems like this should be detected and fixed
> if it happens.
Good suggestion. We don't have that much information on the client than
the fd at this stage (if we never got progress, we don't know device
major and minor numbers), but at least, we'll know that there are bad
behaving client. Added.
Didier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fsckd-daemon-for-inter-fsckd-communication.patch
Type: text/x-diff
Size: 21425 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150217/dfd02588/attachment-0001.patch>
More information about the systemd-devel
mailing list