stgt.vger.kernel.org archive mirror
 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

* Re: Bug: "could not open backing-store directory: /usr/lib/tgt/backing-store" message at startup
  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
  0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2015-11-14 12:46 UTC (permalink / raw)
  To: lduncan; +Cc: stgt

Hi,

On Fri, 13 Nov 2015 20:36:47 +0100
Lee Duncan <lduncan@suse.com> wrote:

> 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?

Sounds reasonable to me. Can you send a patch?

Thanks,

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

* backing-store modules directory not present is not an error
  2015-11-14 12:46 ` FUJITA Tomonori
@ 2015-11-16  1:15   ` Lee Duncan
  2015-11-19  0:43     ` FUJITA Tomonori
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Duncan @ 2015-11-16  1:15 UTC (permalink / raw)
  To: FUJITA Tomonori, stgt

The backing-store modules directory, normally
/usr/lib/tgt/backing-store, is not created, needed, or used when there
are no backing store modules. So change the error message printed when
the directory is not present to a debug message.

Signed-off-by: Lee Duncan <lduncan@suse.com>
---
diff -aurp tgt-1.0.44.orig/usr/bs.c tgt-1.0.44/usr/bs.c
--- tgt-1.0.44.orig/usr/bs.c	2014-02-02 22:56:32.000000000 -0800
+++ tgt-1.0.44/usr/bs.c	2015-11-15 17:14:51.932000000 -0800
@@ -267,7 +267,8 @@ static int bs_init_signalfd(void)

 	dir = opendir(BSDIR);
 	if (dir == NULL) {
-		eprintf("could not open backing-store module directory %s\n",
+		/* not considered an error if there are no modules */
+		dprintf("could not open backing-store module directory %s\n",
 			BSDIR);
 	} else {
 		struct dirent *dirent;

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

* Re: backing-store modules directory not present is not an error
  2015-11-16  1:15   ` backing-store modules directory not present is not an error Lee Duncan
@ 2015-11-19  0:43     ` FUJITA Tomonori
  0 siblings, 0 replies; 4+ messages in thread
From: FUJITA Tomonori @ 2015-11-19  0:43 UTC (permalink / raw)
  To: lduncan; +Cc: stgt

On Sun, 15 Nov 2015 17:15:51 -0800
Lee Duncan <lduncan@suse.com> wrote:

> The backing-store modules directory, normally
> /usr/lib/tgt/backing-store, is not created, needed, or used when there
> are no backing store modules. So change the error message printed when
> the directory is not present to a debug message.
> 
> Signed-off-by: Lee Duncan <lduncan@suse.com>

Applied, thanks.

^ 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;
as well as URLs for NNTP newsgroup(s).