]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: btrfs_ioctl_clone: Truncate complete page after performing clone operation
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Thu, 21 Jan 2016 10:26:04 +0000 (15:56 +0530)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Feb 2016 18:24:29 +0000 (19:24 +0100)
commit93bbbe4f2b13064d74008558ea029d2212bf44a2
treeecb54b0207e6e84cd109b4537a41266d1203cce7
parentd8c2e6eb7935114754826e0e015009776b750342
Btrfs: btrfs_ioctl_clone: Truncate complete page after performing clone operation

In subpagesize-blocksize scenario, the "destination offset" argument passed to
the btrfs_ioctl_clone() can be aligned to sectorsize but may not be
necessarily aligned to the machine's page size. In such cases,
truncate_inode_pages_range() ends up zeroing out the partial page and future
read operations will return incorrect data. Hence this commit explicitly
rounds down the "destination offset" to the machine's page size.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c