From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Allison Henderson <allison.henderson@oracle.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: Parent pointer design bugs
Date: Wed, 10 Jan 2018 14:54:40 -0800 [thread overview]
Message-ID: <20180110225440.GV5602@magnolia> (raw)
In-Reply-To: <adf6f96f-fc4b-e2eb-a204-db8a39007fa7@oracle.com>
On Wed, Jan 10, 2018 at 12:46:16PM -0700, Allison Henderson wrote:
> Hi all,
>
> I've been working on a new xfstest for parent pointers, and discovered
> that parent pointers are not getting created for protofiles.
xfsprogs, IOWs.
> I'm exploring the idea of adding the parent pointer in
> xfs_dir_createname (instead of xfs-create/xfs_link/xfs_rename). But I
> think that means that I'd have to change xfs_dir_createname to take
> the new xfs_inode instead of just the xfs_ino_t.
Yes, you'd probably want to pass the inode to xfs_dir_createname (and I
suppose xfs_dir_removename) if you decide to move the point at which you
queue the pptr defer op into the _dir_ functions.
However, consider the repair case where we either (a) have a dir entry
and no pptr or (b) have a pptr but no dir entry. It's easy to repair
the directory links in either scenario if directory updates and parent
pointer updates are kept as separate libxfs calls.
There's also mkfs/proto.c which want to be able to create an arbitrary
directory tree in exactly the same way as a regular creation would. It
seems to me that the orphanage management functions in repair/phase6.c
are doing basically the same sort of things -- creating the lost+found
directory, linking orphaned inodes into said lost+found directory,
re-stuffing collected directory entries into a directory, etc. Perhaps
it makes more sense to hoist some of the fs/xfs/xfs_inode.c functions
into libxfs, add the pptr calls to those functions, port that to
xfsprogs, and then refactor mkfs/repair to use the new libxfs functions?
FWIW xfs_inode.c is already ~3600 lines long and contains routines for
handling inodes and for various directory manipulations involving
inodes, so I think it's fine to break that file up.
> Which I'm not sure is going to work out in all cases where it is used.
> Before I end up chasing it too long and changing the design too much,
> I wanted to get some feed back to see what folks thoughts were.
> Thanks!
tldr: I'm leaning towards refactor and port some of the xfs_inode
routines to xfsprogs... :)
--D
>
> Allison Henderson
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-01-10 22:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 19:46 Parent pointer design bugs Allison Henderson
2018-01-10 22:54 ` Darrick J. Wong [this message]
2018-01-10 23:58 ` Allison Henderson
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=20180110225440.GV5602@magnolia \
--to=darrick.wong@oracle.com \
--cc=allison.henderson@oracle.com \
--cc=linux-xfs@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 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.