stgt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: stgt@vger.kernel.org
Subject: Bug: "could not open backing-store directory: /usr/lib/tgt/backing-store" message at startup
Date: Fri, 13 Nov 2015 20:36:47 +0100	[thread overview]
Message-ID: <56463BCF.6020001@suse.com> (raw)

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

             reply	other threads:[~2015-11-13 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 19:36 Lee Duncan [this message]
2015-11-14 12:46 ` Bug: "could not open backing-store directory: /usr/lib/tgt/backing-store" message at startup 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56463BCF.6020001@suse.com \
    --to=lduncan@suse.com \
    --cc=stgt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).