All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Linzhe Lee <slayercat.subscription@gmail.com>
Cc: linux-unionfs@vger.kernel.org
Subject: Re: Question about overlayfs over fs not support dirent::ftype
Date: Thu, 10 Dec 2015 07:58:32 +0100	[thread overview]
Message-ID: <20151210065832.GA4732@tucsk> (raw)
In-Reply-To: <CAK_yBkOjkk_70-EvZs_TcRh9Rb7S9jwPQ=AAREHEQToZ+o5sSA@mail.gmail.com>

On Wed, Dec 09, 2015 at 12:42:50PM +0800, Linzhe Lee wrote:
> Hi,all
> 
> I got problem in using overlayfs over fs not support
> dirent::ftype[such as xfs(-n ftype=0)]. After some dig I realized in
> such situation, function ovl_fill_merge parameter d_type will always
> be DT_UNKNOWN.
> 
> I think a warning is needed of course. But because dirent::d_type is
> not widely supported for now. I thought If we can find a way to
> fallback to stat() call in such a situation.  How do you think this
> idea?
> 
> And, can you suggest a method to do it? I tried these method for now,
> but none work.
> 
>     1) Direct get struct inode* from inode::i_ino,  Stuck at not found
> a proper abstract function to do it.
>     2) Get to known fs do not support dirent::d_type and workaround.
> Stuck at not found how to know if fs do not support dirent::d_type
>     3) In function ctx.actor [ovl_fill_merge], use function
> lookup_one_len to get file dirent. Stuck at lock.
> 
> Any thought is helpful. Thank you !

How about the patch below?

Does that fix the issue?

Thanks,
Miklos


---
 fs/overlayfs/readdir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -98,7 +98,7 @@ static struct ovl_cache_entry *ovl_cache
 	p->ino = ino;
 	p->is_whiteout = false;
 
-	if (d_type == DT_CHR) {
+	if (d_type == DT_CHR || d_type == DT_UNKNOWN) {
 		p->next_maybe_whiteout = rdd->first_maybe_whiteout;
 		rdd->first_maybe_whiteout = p;
 	}

  reply	other threads:[~2015-12-10  6:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09  4:42 Question about overlayfs over fs not support dirent::ftype Linzhe Lee
2015-12-10  6:58 ` Miklos Szeredi [this message]
2015-12-11  3:51   ` Linzhe Lee
2015-12-13  4:51   ` Linzhe Lee

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=20151210065832.GA4732@tucsk \
    --to=miklos@szeredi.hu \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=slayercat.subscription@gmail.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.