]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: deal with short returns from copy_from_user
authorChris Mason <chris.mason@oracle.com>
Mon, 7 Mar 2011 16:10:24 +0000 (11:10 -0500)
committerChris Mason <chris.mason@oracle.com>
Mon, 7 Mar 2011 16:10:24 +0000 (11:10 -0500)
commit4861d20aee552754bc08e046abe0083156369109
treec1f2d464acfc97e8c5faecf57e644578cccce94d
parent92c0b66be285152be12b9dd96090e2c5b4081a85
Btrfs: deal with short returns from copy_from_user

When copy_from_user is only able to copy some of the bytes we requested,
we may end up creating a partially up to date page.  To avoid garbage in
the page, we need to treat a partial copy as a zero length copy.

This makes the rest of the file_write code drop the page and
retry the whole copy instead of marking the partially up to
date page as dirty.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
cc: stable@kernel.org
fs/btrfs/file.c