From: Christoph Hellwig <hch@lst.de>
To: Tom Haynes <thomas.haynes@primarydata.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 3/4] nfsd: Add a super simple flex file server
Date: Wed, 25 May 2016 17:15:04 +0200 [thread overview]
Message-ID: <20160525151504.GD27535@lst.de> (raw)
In-Reply-To: <1464152979-103988-4-git-send-email-loghyr@primarydata.com>
Nice! A few comments below:
> + * where the NFSv4.1 mds is also the ds. And the storage is
> + * the same. I.e., writing to the mds via a NFSv4.1 WRITE
> + * goes to the same location as the NFSv3 WRITE.
> + */
> +#include <linux/exportfs.h>
> +#include <linux/genhd.h>
> +#include <linux/pr.h>
I don't think you need any of the three headers above.
> +static __be32
> +nfsd4_ff_proc_layoutget(struct inode *inode, const struct svc_fh *fhp,
> + struct nfsd4_layoutget *args)
> +{
> + struct nfsd4_layout_seg *seg = &args->lg_seg;
> + u32 block_size = (1 << inode->i_blkbits);
> + u32 device_generation = 0;
> + int error;
> +
> + struct pnfs_ff_layout *fl;
> +
> + if (seg->offset & (block_size - 1)) {
> + dprintk("pnfsd: I/O misaligned\n");
> + goto out_layoutunavailable;
> + }
Do we really care about aligned I/O for flexfiles layouts?
> + * effectively be WRITE only.
> + */
> + fl->flags = FF_FLAGS_NO_LAYOUTCOMMIT | FF_FLAGS_NO_IO_THRU_MDS |
> + FF_FLAGS_NO_READ_IO;
> +
> + fl->uid = inode->i_uid;
> + fl->gid = inode->i_gid;
Maybe I need to actually read the latest draft, but what's the story
about these on the wire uids/gids?
> +#ifdef CONFIG_NFSD_FLEXFILELAYOUT
I don't think you need this - the whole file is conditional on this
symbol.
> + if (sb->s_bdev != sb->s_bdev->bd_contains)
> + return nfserr_inval;
Shouldn't be needed.
> +#include <linux/exportfs.h>
probably not needed.
> +struct iomap;
no needed.
> void nfsd4_setup_layout_type(struct svc_export *exp)
> {
> +#if defined(CONFIG_NFSD_BLOCKLAYOUT) || defined(CONFIG_NFSD_SCSILAYOUT)
> struct super_block *sb = exp->ex_path.mnt->mnt_sb;
> +#endif
>
> if (!(exp->ex_flags & NFSEXP_PNFS))
> return;
> @@ -145,6 +150,11 @@ void nfsd4_setup_layout_type(struct svc_export *exp)
> sb->s_bdev && sb->s_bdev->bd_disk->fops->pr_ops)
> exp->ex_layout_type = LAYOUT_SCSI;
> #endif
> +#ifdef CONFIG_NFSD_FLEXFILELAYOUT
> + // FIXME: How do we "export" this and how does it mingle with
> + // the above types?
> + exp->ex_layout_type = LAYOUT_FLEX_FILES;
> +#endif
As pointed out by Jeff we'll probably need a bitmap of supported layouts
here. Something like
unsigned long ex_layout_types;
...
if (supported)
ex_layout_types |= (1 << LAYOUT_XXX)
probably best done as a separate preparation patch.
The other issue is that the Linux client is currently confused when
more than a single layout type is supported - we'll need some sort
of runtime option to chose the layout(s) supported.
next prev parent reply other threads:[~2016-05-25 15:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 5:09 [PATCH 0/4] Super simple flex file server Tom Haynes
2016-05-25 5:09 ` [PATCH 1/4] nfsd: flex file device id encoding will need the server addres Tom Haynes
2016-05-25 11:49 ` Jeff Layton
2016-05-25 15:08 ` Christoph Hellwig
2016-05-25 5:09 ` [PATCH 2/4] nfsd: Can leak pnfs_block_extent on error Tom Haynes
2016-05-25 11:50 ` Jeff Layton
2016-05-25 15:07 ` Christoph Hellwig
2016-05-25 18:12 ` Thomas Haynes
2016-05-25 18:20 ` J. Bruce Fields
2016-05-25 5:09 ` [PATCH 3/4] nfsd: Add a super simple flex file server Tom Haynes
2016-05-25 12:00 ` Jeff Layton
2016-05-25 12:30 ` Jeff Layton
2016-05-25 14:41 ` Thomas Haynes
2016-05-25 17:42 ` J. Bruce Fields
2016-05-25 21:57 ` Jeff Layton
2016-05-26 13:18 ` J. Bruce Fields
2016-05-25 15:15 ` Christoph Hellwig [this message]
2016-05-26 5:37 ` Thomas Haynes
2016-05-25 5:09 ` [PATCH 4/4] nfsd: Provide a config option for flex file layouts Tom Haynes
2016-05-25 15:09 ` Christoph Hellwig
2016-05-25 18:19 ` Thomas Haynes
2016-05-25 18:21 ` J. Bruce Fields
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=20160525151504.GD27535@lst.de \
--to=hch@lst.de \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=thomas.haynes@primarydata.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 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).