public inbox for stgt@vger.kernel.org
 help / color / mirror / Atom feed
* Bug: "could not open backing-store directory: /usr/lib/tgt/backing-store" message at startup
@ 2015-11-13 19:36 Lee Duncan
  2015-11-14 12:46 ` FUJITA Tomonori
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Duncan @ 2015-11-13 19:36 UTC (permalink / raw)
  To: stgt

Hello:

I have found a small problem recently when tgtd is configured for no
back-end support modules.

The Makefile in usr has these lines:

> install: $(PROGRAMS) $(MODULES)
> 	install -d -m 755 $(DESTDIR)$(sbindir)
> 	install -m 755 $(PROGRAMS) $(DESTDIR)$(sbindir)
> ifneq ($(MODULES),)
> 	install -d -m 755 $(DESTDIR)$(libdir)/backing-store
> 	install -m 755 $(MODULES) $(DESTDIR)$(libdir)/backing-store
> endif
> 

So if no modules are defined, that the backing-store directory will
never get created. Which makes sense I suppose -- it will never be
needed, since it is only used for modules.

But then the code in usr/bs.c seems to consider it an error when the
directory does not exist:

> static int bs_init_signalfd(void)
> {
> 	sigset_t mask;
> 	int ret;
> 	DIR *dir;
> 
> 	dir = opendir(BSDIR);
> 	if (dir == NULL) {
> 		eprintf("could not open backing-store module directory %s\n",
> 			BSDIR);
> 	} else {
> ...
> }

causing an error message each time tgtd starts, and this shows up on the
systemd status output, which is not good.

This seems like more of an informational message in this case, since the
bs_init_signalfd() function does not return a failure code in this case.

It seems like the "right" way to fix it would be change this code to not
consider this case an error -- perhaps just a debugging message?

Another simple solution would be to change the Makefile so that the
backing-store directory always gets created, and only the installation
of MODULES becomes conditional on having MODULES.

I can supply a patch for either case. Which would you prefer?
-- 
Lee Duncan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-19  0:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 19:36 Bug: "could not open backing-store directory: /usr/lib/tgt/backing-store" message at startup Lee Duncan
2015-11-14 12:46 ` FUJITA Tomonori
2015-11-16  1:15   ` backing-store modules directory not present is not an error Lee Duncan
2015-11-19  0:43     ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox