linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout
@ 2011-09-20 18:52 Fred Isaman
  2011-09-21  9:51 ` Boaz Harrosh
  0 siblings, 1 reply; 5+ messages in thread
From: Fred Isaman @ 2011-09-20 18:52 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust

This is a backport of critical parts of
commit 7c24d9489f "NFSv4.1: File layout only supports whole file layouts"

It prevents the file layout driver from (incorrectly) using
partial layouts, but ignores the part of the referenced commmit that
relies on additional machinery to change the LAYOUTGET request
based on layout driver.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4filelayout.c |    8 ++++++++
 fs/nfs/pnfs.c           |    3 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 614c4d2..75af812 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -428,6 +428,14 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
 
 	dprintk("--> %s\n", __func__);
 
+	/* FIXME: remove this check when layout segment support is added */
+	if (lgr->range.offset != 0 ||
+	    lgr->range.length != NFS4_MAX_UINT64) {
+		dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
+			__func__);
+		goto out;
+	}
+
 	if (fl->pattern_offset > lgr->range.offset) {
 		dprintk("%s pattern_offset %lld too large\n",
 				__func__, fl->pattern_offset);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index a726c0a..36d2a29 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -980,7 +980,8 @@ pnfs_update_layout(struct inode *ino,
 		arg.offset -= pg_offset;
 		arg.length += pg_offset;
 	}
-	arg.length = PAGE_CACHE_ALIGN(arg.length);
+	if (arg.length != NFS4_MAX_UINT64)
+		arg.length = PAGE_CACHE_ALIGN(arg.length);
 
 	lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
 	if (!lseg && first) {
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout
  2011-09-20 18:52 [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout Fred Isaman
@ 2011-09-21  9:51 ` Boaz Harrosh
  2011-09-21 13:11   ` Fred Isaman
  0 siblings, 1 reply; 5+ messages in thread
From: Boaz Harrosh @ 2011-09-21  9:51 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs, Trond Myklebust, Matt W. Benjamin, Adam C. Emerson

On 09/20/2011 09:52 PM, Fred Isaman wrote:
> This is a backport of critical parts of
> commit 7c24d9489f "NFSv4.1: File layout only supports whole file layouts"
> 
> It prevents the file layout driver from (incorrectly) using
> partial layouts, but ignores the part of the referenced commmit that
> relies on additional machinery to change the LAYOUTGET request
> based on layout driver.
> 
> Signed-off-by: Fred Isaman <iisaman@netapp.com>

Hi Fred

Do you know of any plans/timetables to support segments in the files-layout-driver?
Both objects and blocks do support it.
Is there some missing generic infrastructure needed or its only LD stuff?

Just that I know of a few files-based servers that can only serve segments
and are unusable with current Linux-pNFS-client which is a great pity.

I wish it could be ready for next BAT

Thanks
Boaz

> ---
>  fs/nfs/nfs4filelayout.c |    8 ++++++++
>  fs/nfs/pnfs.c           |    3 ++-
>  2 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> index 614c4d2..75af812 100644
> --- a/fs/nfs/nfs4filelayout.c
> +++ b/fs/nfs/nfs4filelayout.c
> @@ -428,6 +428,14 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
>  
>  	dprintk("--> %s\n", __func__);
>  
> +	/* FIXME: remove this check when layout segment support is added */
> +	if (lgr->range.offset != 0 ||
> +	    lgr->range.length != NFS4_MAX_UINT64) {
> +		dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
> +			__func__);
> +		goto out;
> +	}
> +
>  	if (fl->pattern_offset > lgr->range.offset) {
>  		dprintk("%s pattern_offset %lld too large\n",
>  				__func__, fl->pattern_offset);
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index a726c0a..36d2a29 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -980,7 +980,8 @@ pnfs_update_layout(struct inode *ino,
>  		arg.offset -= pg_offset;
>  		arg.length += pg_offset;
>  	}
> -	arg.length = PAGE_CACHE_ALIGN(arg.length);
> +	if (arg.length != NFS4_MAX_UINT64)
> +		arg.length = PAGE_CACHE_ALIGN(arg.length);
>  
>  	lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
>  	if (!lseg && first) {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout
  2011-09-21  9:51 ` Boaz Harrosh
@ 2011-09-21 13:11   ` Fred Isaman
       [not found]     ` <CADnza47=3Q53=DO=KMdeu_snuQ-q3RV2KshfMOwXL6o+BcYaLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-10-12 16:00     ` Boaz Harrosh
  0 siblings, 2 replies; 5+ messages in thread
From: Fred Isaman @ 2011-09-21 13:11 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: linux-nfs, Trond Myklebust, Matt W. Benjamin, Adam C. Emerson

On Wed, Sep 21, 2011 at 5:51 AM, Boaz Harrosh <bharrosh@panasas.com> wr=
ote:
> On 09/20/2011 09:52 PM, Fred Isaman wrote:
>> This is a backport of critical parts of
>> commit 7c24d9489f "NFSv4.1: File layout only supports whole file lay=
outs"
>>
>> It prevents the file layout driver from (incorrectly) using
>> partial layouts, but ignores the part of the referenced commmit that
>> relies on additional machinery to change the LAYOUTGET request
>> based on layout driver.
>>
>> Signed-off-by: Fred Isaman <iisaman@netapp.com>
>
> Hi Fred
>
> Do you know of any plans/timetables to support segments in the files-=
layout-driver?
> Both objects and blocks do support it.
> Is there some missing generic infrastructure needed or its only LD st=
uff?
>

I plan on having something to test at BAT.

=46red

> Just that I know of a few files-based servers that can only serve seg=
ments
> and are unusable with current Linux-pNFS-client which is a great pity=
=2E
>
> I wish it could be ready for next BAT
>
> Thanks
> Boaz
>
>> ---
>> =A0fs/nfs/nfs4filelayout.c | =A0 =A08 ++++++++
>> =A0fs/nfs/pnfs.c =A0 =A0 =A0 =A0 =A0 | =A0 =A03 ++-
>> =A02 files changed, 10 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
>> index 614c4d2..75af812 100644
>> --- a/fs/nfs/nfs4filelayout.c
>> +++ b/fs/nfs/nfs4filelayout.c
>> @@ -428,6 +428,14 @@ filelayout_check_layout(struct pnfs_layout_hdr =
*lo,
>>
>> =A0 =A0 =A0 dprintk("--> %s\n", __func__);
>>
>> + =A0 =A0 /* FIXME: remove this check when layout segment support is=
 added */
>> + =A0 =A0 if (lgr->range.offset !=3D 0 ||
>> + =A0 =A0 =A0 =A0 lgr->range.length !=3D NFS4_MAX_UINT64) {
>> + =A0 =A0 =A0 =A0 =A0 =A0 dprintk("%s Only whole file layouts suppor=
ted. Use MDS i/o\n",
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__);
>> + =A0 =A0 =A0 =A0 =A0 =A0 goto out;
>> + =A0 =A0 }
>> +
>> =A0 =A0 =A0 if (fl->pattern_offset > lgr->range.offset) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 dprintk("%s pattern_offset %lld too larg=
e\n",
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__=
, fl->pattern_offset);
>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>> index a726c0a..36d2a29 100644
>> --- a/fs/nfs/pnfs.c
>> +++ b/fs/nfs/pnfs.c
>> @@ -980,7 +980,8 @@ pnfs_update_layout(struct inode *ino,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 arg.offset -=3D pg_offset;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 arg.length +=3D pg_offset;
>> =A0 =A0 =A0 }
>> - =A0 =A0 arg.length =3D PAGE_CACHE_ALIGN(arg.length);
>> + =A0 =A0 if (arg.length !=3D NFS4_MAX_UINT64)
>> + =A0 =A0 =A0 =A0 =A0 =A0 arg.length =3D PAGE_CACHE_ALIGN(arg.length=
);
>>
>> =A0 =A0 =A0 lseg =3D send_layoutget(lo, ctx, &arg, gfp_flags);
>> =A0 =A0 =A0 if (!lseg && first) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout
       [not found]     ` <CADnza47=3Q53=DO=KMdeu_snuQ-q3RV2KshfMOwXL6o+BcYaLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-09-21 13:44       ` Boaz Harrosh
  0 siblings, 0 replies; 5+ messages in thread
From: Boaz Harrosh @ 2011-09-21 13:44 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs, Trond Myklebust, Matt W. Benjamin, Adam C. Emerson

On 09/21/2011 04:11 PM, Fred Isaman wrote:
>>
>> Do you know of any plans/timetables to support segments in the files-layout-driver?
>> Both objects and blocks do support it.
>> Is there some missing generic infrastructure needed or its only LD stuff?
>>
> 
> I plan on having something to test at BAT.
> 
> Fred
> 

Grate, Perfect thank
Boaz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout
  2011-09-21 13:11   ` Fred Isaman
       [not found]     ` <CADnza47=3Q53=DO=KMdeu_snuQ-q3RV2KshfMOwXL6o+BcYaLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-10-12 16:00     ` Boaz Harrosh
  1 sibling, 0 replies; 5+ messages in thread
From: Boaz Harrosh @ 2011-10-12 16:00 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs, Trond Myklebust, Matt W. Benjamin, Adam C. Emerson

On 09/21/2011 04:11 PM, Fred Isaman wrote:
>>
>> Do you know of any plans/timetables to support segments in the files-layout-driver?
>> Both objects and blocks do support it.
>> Is there some missing generic infrastructure needed or its only LD stuff?
>>
> 
> I plan on having something to test at BAT.
> 
> Fred
> 

Hi Fred

any news on the files-layout segments support? Do you have an RFC
quality code that we can play around with?

Thanks
Boaz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-12 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 18:52 [PATCH 1/1] Prevent 3.0 from crashing if it receives a partial layout Fred Isaman
2011-09-21  9:51 ` Boaz Harrosh
2011-09-21 13:11   ` Fred Isaman
     [not found]     ` <CADnza47=3Q53=DO=KMdeu_snuQ-q3RV2KshfMOwXL6o+BcYaLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-21 13:44       ` Boaz Harrosh
2011-10-12 16:00     ` Boaz Harrosh

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).