All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [RFC PATCH v2] ovl: don't follow redirects if redirect_dir=off
Date: Sun, 10 Dec 2017 08:29:11 +0200	[thread overview]
Message-ID: <CAOQ4uxj0wXKbUZ2m=rH=89w+ZP_vibCH_ND2saC05kt19ApcxA@mail.gmail.com> (raw)
In-Reply-To: <30533.1512743808@warthog.procyon.org.uk>

On Fri, Dec 8, 2017 at 4:36 PM, David Howells <dhowells@redhat.com> wrote:
> Miklos Szeredi <miklos@szeredi.hu> wrote:
>
>> +     const char *redirect_mode;
>> ...
>> +     kfree(ofs->config.redirect_mode);
>
> That's going to get you a compiler warning under some circumstances.
>
>> +                     config->redirect_mode = match_strdup(&args[0]);
>
> We shouldn't really be copying the string if we can help it, though I grant we
> may not have the match_*() function to do otherwise at the moment.  I would
> much prefer seeing it rendered to an enum value at this point.
>

If we store config->redirect_mode as bitmask, then it would be nicer
for testing redirect/follow independently as Miklos wanted and it would
be still nice for checking if mode is not the default, i.e.:

#define OVL_REDIRECT_DIR 0x1 /* flag casted from bool ovl_redirect_dir_def */
#define OVL_REDIRECT_FOLLOW 0x2

       if (ofs->config.redirect_mode != (unsigned) ovl_redirect_dir_def)
               seq_printf(m, ",redirect_dir=%s", ovl_redirect_mode_str(ofs));


Amir.

  reply	other threads:[~2017-12-10  6:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 15:03 [RFC PATCH v2] ovl: don't follow redirects if redirect_dir=off Miklos Szeredi
2017-12-06 16:33 ` Amir Goldstein
2017-12-06 18:25   ` Amir Goldstein
2017-12-07  9:25   ` Miklos Szeredi
2017-12-08 14:36 ` David Howells
2017-12-10  6:29   ` Amir Goldstein [this message]
2017-12-11  9:33   ` Miklos Szeredi

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='CAOQ4uxj0wXKbUZ2m=rH=89w+ZP_vibCH_ND2saC05kt19ApcxA@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=vgoyal@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.