From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Suvanto Subject: Re: [PATCH] Btrfs: fix arithmetic error in clone ioctl Date: Wed, 26 Aug 2009 10:19:50 +0300 Message-ID: References: <20090824115232.GC15449@think> <4A928CEF.2060903@dpf.gov.br> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Atila , linux-btrfs@vger.kernel.org, Chris Mason To: Sage Weil Return-path: In-Reply-To: List-ID: 2009/8/25 Sage Weil : > Markus, > > This should fix your problem! > It works now , thanks! -Markus > --- > Subject: [PATCH] Btrfs: fix arithmetic error in clone ioctl > > Fix an arithmetic error that was breaking extents cloned via the clon= e > ioctl starting in the second half of a file. > > Signed-off-by: Sage Weil > --- > =A0fs/btrfs/ioctl.c | =A0 =A03 +-- > =A01 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > index e8e4ebe..63ca12a 100644 > --- a/fs/btrfs/ioctl.c > +++ b/fs/btrfs/ioctl.c > @@ -1072,8 +1072,7 @@ static long btrfs_ioctl_clone(struct file *file= , unsigned long srcfd, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0datao +=3D off - key.offset; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0datal -=3D off - key.offset; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (key= =2Eoffset + datao + datal + key.offset > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= off + len) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (key= =2Eoffset + datao + datal > off + len) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0datal =3D off + len - key.offset - datao; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* dis= ko =3D=3D 0 means it's a hole */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!d= isko) > -- > 1.5.6.5 > > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html