Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629972 > unrolled thread

[PATCH 2/2 linux-next] fs/affs: bugfix: Write files greater than page size on OFS

Started byFabian Frederick <fabf@skynet.be>
First post2017-04-24 22:20 +0200
Last post2017-04-24 22:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/2 linux-next] fs/affs: bugfix: Write files greater than page size on OFS Fabian Frederick <fabf@skynet.be> - 2017-04-24 22:20 +0200

#1629972 — [PATCH 2/2 linux-next] fs/affs: bugfix: Write files greater than page size on OFS

FromFabian Frederick <fabf@skynet.be>
Date2017-04-24 22:20 +0200
Subject[PATCH 2/2 linux-next] fs/affs: bugfix: Write files greater than page size on OFS
Message-ID<tzSCL-37e-37@gated-at.bofh.it>
Previous AFFS patch fixed OFS write operations but unveiled
another bug: files greater than 4KB are being created with a wrong
size resulting in errors like the following:

dd if=/dev/zero of=file bs=4097 count=1
cp file /mnt/affs/
cp: error writing '/mnt/affs/file': Bad address

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/affs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/affs/file.c b/fs/affs/file.c
index e5c5de6..196ee7f 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -679,7 +679,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
 	int written;
 
 	from = pos & (PAGE_SIZE - 1);
-	to = pos + len;
+	to = from + len;
 	/*
 	 * XXX: not sure if this can handle short copies (len < copied), but
 	 * we don't have to, because the page should always be uptodate here,
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web