FIXME: BUG wdata->mds_offset never gets set
Subsystems (2)
PATCH 1/1 FIXME: BUG wdata->mds_offset never gets set
The fileslayout and blockslayout drivers had a set of wdata->mds_offset in their .write_pagelist member.
The objects driver did not. Which breaks layout_commit.
FIXME: Since all drivers set mds_offset in exactly the same place to the same value. And then never touch it. It calls for the generic layer to take care of it.
(I'll send the fix tomorrow)
--- fs/nfs/objlayout/objlayout.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/objlayout/objlayout.c +2 -0
@@ -430,6 +430,8 @@ objlayout_write_pagelist(struct nfs_write_data *wdata, status =objio_write_pagelist (state, how &FLUSH_STABLE ); out:dprintk ("%s: Return status %Zd\n" , __func__, status); +/* pnfs_set_layoutcommit needs this */ + wdata->mds_offset = wdata->args.offset; wdata->pnfs_error = status;return PNFS_ATTEMPTED ; }
Signature · 1 line
1.7.3.4
Quoted 10 lines · Boaz Harrosh
The fileslayout and blockslayout drivers had a set of
wdata->mds_offsetin their .write_pagelist member.The objects driver did not. Which breaks
layout_commit.FIXME: Since all drivers set
mds_offsetin exactly the same place to the same value. And then never touch it. It calls for the generic layer to take care of it.
(I'll send the fix tomorrow)
Thanks, that's indeed a fallout from 4b8ee2b
"nfs41: Correct offset for LAYOUTCOMMIT"
I merged this also for pnfs-all-2.6.39
Benny
Quoted 19 lines
Signed-off-by Boaz Harrosh <[email protected]>--- fs/nfs/objlayout/objlayout.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/nfs/objlayout/objlayout.c +2
-0@@ -430,6 +430,8 @@ objlayout_write_pagelist(struct nfs_write_data *wdata, status =objio_write_pagelist (state, how &FLUSH_STABLE ); out:dprintk ("%s: Return status %Zd\n" , __func__, status); +/* pnfs_set_layoutcommit needs this */ + wdata->mds_offset = wdata->args.offset; wdata->pnfs_error = status;return PNFS_ATTEMPTED ; }
Signature · 5 lines
Benny Halevy CTO, Tonian Inc. Tel: +972-54-802-8340 [email protected]
Quoted 12 lines · Benny Halevy
Quoted 10 lines · Boaz Harrosh
The fileslayout and blockslayout drivers had a set of
wdata->mds_offsetin their .write_pagelist member.The objects driver did not. Which breaks
layout_commit.FIXME: Since all drivers set
mds_offsetin exactly the same place to the same value. And then never touch it. It calls for the generic layer to take care of it.
(I'll send the fix tomorrow)
Quoted 7 lines
Thanks, that's indeed a fallout from 4b8ee2b
"nfs41: Correct offset for LAYOUTCOMMIT"I merged this also for pnfs-all-2.6.39
Benny
I talked to both Fred And Andy and they agreed with me that we should move the assignment to the generic layer. It's a layering violation this way. I'll send you a patch today
Thanks
Boaz
Quoted 20 lines
Quoted 19 lines
Signed-off-by Boaz Harrosh <[email protected]>--- fs/nfs/objlayout/objlayout.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/nfs/objlayout/objlayout.c +2
-0@@ -430,6 +430,8 @@ objlayout_write_pagelist(struct nfs_write_data *wdata, status =objio_write_pagelist (state, how &FLUSH_STABLE ); out:dprintk ("%s: Return status %Zd\n" , __func__, status); +/* pnfs_set_layoutcommit needs this */ + wdata->mds_offset = wdata->args.offset; wdata->pnfs_error = status;return PNFS_ATTEMPTED ; }
PATCH 1/3 pnfs: write: Set mds_offset in the generic layer - it is needed by all LDs
In reply to Boaz HarroshIn current pnfs tree, all the layouts set mds_offset in their .write_pagelist member.mds_offset is only used by generic layer and should be handled by it.
This patch is for upstream. It is needed in this -rc series to fix a bug in objects layout_commit.
I'll send patches for objects and blocks to be
squashed into current pnfs tree.
TODO: It looks like the read path needs the same patch.
--- fs/nfs/nfs4filelayout.c | 1 - fs/nfs/write.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletions(-)
fs/nfs/nfs4filelayout.c +0 -1
@@ -396,7 +396,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)* this offset and save the original offset. */ data->args.offset =filelayout_get_dserver_offset (lseg, offset); - data->mds_offset = offset;/* Perform an asynchronous write */ status = nfs_initiate_write(data, ds->ds_clp->cl_rpcclient,
fs/nfs/write.c +2 -0
@@ -868,6 +868,8 @@ static int nfs_write_rpcsetup(struct nfs_page *req, data->args.fh =NFS_FH (inode); data->args.offset =req_offset (req) + offset; +/* pnfs_set_layoutcommit needs this */ + data->mds_offset = data->args.offset; data->args.pgbase = req->wb_pgbase + offset; data->args.pages = data->pagevec; data->args.count = count;
Signature · 1 line
1.7.3.4
PATCH 2/3 SQUASHME pnfs-blocks: mds_offset is set in the generic layer
In reply to Boaz Harrosh--- fs/nfs/blocklayout/blocklayout.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfs/blocklayout/blocklayout.c +0 -2
@@ -495,8 +495,6 @@ bl_write_pagelist(struct nfs_write_data *wdata, wdata->res.count = (isect <<9 ) - (offset);if (count < wdata->res.count) wdata->res.count = count; -/* pnfs_set_layoutcommit needs this */ - wdata->mds_offset = offset;put_extent (be);bl_submit_bio (WRITE , bio);put_parallel (par);
Signature · 1 line
1.7.3.4
PATCH 3/3 SQUASHME: pnfs-obj: mds_offset is set in the generic layer
In reply to Boaz HarroshBenny you can just remove the previous patch that adds it:
b5157c1 FIXME: BUG wdata->mds_offset never gets set
This patch is just a reminder
--- fs/nfs/objlayout/objlayout.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfs/objlayout/objlayout.c +0 -2
@@ -430,8 +430,6 @@ objlayout_write_pagelist(struct nfs_write_data *wdata, status =objio_write_pagelist (state, how &FLUSH_STABLE ); out:dprintk ("%s: Return status %Zd\n" , __func__, status); -/* pnfs_set_layoutcommit needs this */ - wdata->mds_offset = wdata->args.offset; wdata->pnfs_error = status;return PNFS_ATTEMPTED ; }
Signature · 1 line
1.7.3.4