* [PATCH] nfs41: Correct offset for LAYOUTCOMMIT
@ 2011-05-19 19:10 Vitaliy Gusev
2011-05-19 19:38 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Vitaliy Gusev @ 2011-05-19 19:10 UTC (permalink / raw)
To: Trond.Myklebust; +Cc: andros, linux-nfs, Vitaliy Gusev
A client sends offset to MDS as it was seen by DS. As result,
file size after copy is only half of original file size in case
of 2 DS.
Signed-off-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
---
fs/nfs/nfs4filelayout.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index be79dc9..790eb1d 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -167,6 +167,7 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
wdata->res.verf->committed == NFS_FILE_SYNC)
return;
+ wdata->args.offset = wdata->mds_offset;
pnfs_set_layoutcommit(wdata);
dprintk("%s ionde %lu pls_end_pos %lu\n", __func__, wdata->inode->i_ino,
(unsigned long) wdata->lseg->pls_end_pos);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs41: Correct offset for LAYOUTCOMMIT
2011-05-19 19:10 [PATCH] nfs41: Correct offset for LAYOUTCOMMIT Vitaliy Gusev
@ 2011-05-19 19:38 ` Trond Myklebust
2011-05-19 19:45 ` Vitaliy Gusev
0 siblings, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2011-05-19 19:38 UTC (permalink / raw)
To: Vitaliy Gusev; +Cc: andros, linux-nfs, Vitaliy Gusev
On Thu, 2011-05-19 at 23:10 +0400, Vitaliy Gusev wrote:
> A client sends offset to MDS as it was seen by DS. As result,
> file size after copy is only half of original file size in case
> of 2 DS.
>
> Signed-off-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
> ---
> fs/nfs/nfs4filelayout.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> index be79dc9..790eb1d 100644
> --- a/fs/nfs/nfs4filelayout.c
> +++ b/fs/nfs/nfs4filelayout.c
> @@ -167,6 +167,7 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
> wdata->res.verf->committed == NFS_FILE_SYNC)
> return;
>
> + wdata->args.offset = wdata->mds_offset;
> pnfs_set_layoutcommit(wdata);
> dprintk("%s ionde %lu pls_end_pos %lu\n", __func__, wdata->inode->i_ino,
> (unsigned long) wdata->lseg->pls_end_pos);
Err... Shouldn't we rather be fixing pnfs_set_layoutcommit() to use the
mds_offset instead of hacking args.offset?
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs41: Correct offset for LAYOUTCOMMIT
2011-05-19 19:38 ` Trond Myklebust
@ 2011-05-19 19:45 ` Vitaliy Gusev
2011-05-19 19:56 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Vitaliy Gusev @ 2011-05-19 19:45 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Vitaliy Gusev, andros, linux-nfs
On 05/19/2011 11:38 PM, Trond Myklebust wrote:
> On Thu, 2011-05-19 at 23:10 +0400, Vitaliy Gusev wrote:
>> A client sends offset to MDS as it was seen by DS. As result,
>> file size after copy is only half of original file size in case
>> of 2 DS.
>>
>> Signed-off-by: Vitaliy Gusev<gusev.vitaliy@nexenta.com>
>> ---
>> fs/nfs/nfs4filelayout.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
>> index be79dc9..790eb1d 100644
>> --- a/fs/nfs/nfs4filelayout.c
>> +++ b/fs/nfs/nfs4filelayout.c
>> @@ -167,6 +167,7 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
>> wdata->res.verf->committed == NFS_FILE_SYNC)
>> return;
>>
>> + wdata->args.offset = wdata->mds_offset;
>> pnfs_set_layoutcommit(wdata);
>> dprintk("%s ionde %lu pls_end_pos %lu\n", __func__, wdata->inode->i_ino,
>> (unsigned long) wdata->lseg->pls_end_pos);
>
> Err... Shouldn't we rather be fixing pnfs_set_layoutcommit() to use the
> mds_offset instead of hacking args.offset?
I thought about it... pnfs_set_layoutcommit is a generic code for all
type of layouts, but mds_offset is set only for file layout.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs41: Correct offset for LAYOUTCOMMIT
2011-05-19 19:45 ` Vitaliy Gusev
@ 2011-05-19 19:56 ` Trond Myklebust
0 siblings, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2011-05-19 19:56 UTC (permalink / raw)
To: Vitaliy Gusev; +Cc: Vitaliy Gusev, andros, linux-nfs
On Thu, 2011-05-19 at 23:45 +0400, Vitaliy Gusev wrote:
> On 05/19/2011 11:38 PM, Trond Myklebust wrote:
> > On Thu, 2011-05-19 at 23:10 +0400, Vitaliy Gusev wrote:
> >> A client sends offset to MDS as it was seen by DS. As result,
> >> file size after copy is only half of original file size in case
> >> of 2 DS.
> >>
> >> Signed-off-by: Vitaliy Gusev<gusev.vitaliy@nexenta.com>
> >> ---
> >> fs/nfs/nfs4filelayout.c | 1 +
> >> 1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> >> index be79dc9..790eb1d 100644
> >> --- a/fs/nfs/nfs4filelayout.c
> >> +++ b/fs/nfs/nfs4filelayout.c
> >> @@ -167,6 +167,7 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
> >> wdata->res.verf->committed == NFS_FILE_SYNC)
> >> return;
> >>
> >> + wdata->args.offset = wdata->mds_offset;
> >> pnfs_set_layoutcommit(wdata);
> >> dprintk("%s ionde %lu pls_end_pos %lu\n", __func__, wdata->inode->i_ino,
> >> (unsigned long) wdata->lseg->pls_end_pos);
> >
> > Err... Shouldn't we rather be fixing pnfs_set_layoutcommit() to use the
> > mds_offset instead of hacking args.offset?
>
> I thought about it... pnfs_set_layoutcommit is a generic code for all
> type of layouts, but mds_offset is set only for file layout.
If we're going to use the struct nfs_write_data as the parameter to
pnfs_set_layoutcommit, then we can and should require that the fields be
correctly initialised. It's another matter altogether that the choice of
nfs_write_data may have been a poor one if other layouts don't use it.
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-19 20:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19 19:10 [PATCH] nfs41: Correct offset for LAYOUTCOMMIT Vitaliy Gusev
2011-05-19 19:38 ` Trond Myklebust
2011-05-19 19:45 ` Vitaliy Gusev
2011-05-19 19:56 ` Trond Myklebust
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.