| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /** |
|---|
| 2 | 3 | * eCryptfs: Linux filesystem encryption layer |
|---|
| 3 | 4 | * This is where eCryptfs coordinates the symmetric encryption and |
|---|
| .. | .. |
|---|
| 8 | 9 | * Copyright (C) 2001-2003 Stony Brook University |
|---|
| 9 | 10 | * Copyright (C) 2004-2007 International Business Machines Corp. |
|---|
| 10 | 11 | * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or |
|---|
| 13 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 14 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 15 | | - * License, or (at your option) any later version. |
|---|
| 16 | | - * |
|---|
| 17 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 18 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 19 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 20 | | - * General Public License for more details. |
|---|
| 21 | | - * |
|---|
| 22 | | - * You should have received a copy of the GNU General Public License |
|---|
| 23 | | - * along with this program; if not, write to the Free Software |
|---|
| 24 | | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
|---|
| 25 | | - * 02111-1307, USA. |
|---|
| 26 | 12 | */ |
|---|
| 27 | 13 | |
|---|
| 28 | 14 | #include <linux/pagemap.h> |
|---|
| .. | .. |
|---|
| 436 | 422 | } |
|---|
| 437 | 423 | inode_lock(lower_inode); |
|---|
| 438 | 424 | size = __vfs_getxattr(lower_dentry, lower_inode, ECRYPTFS_XATTR_NAME, |
|---|
| 439 | | - xattr_virt, PAGE_SIZE); |
|---|
| 425 | + xattr_virt, PAGE_SIZE, XATTR_NOSECURITY); |
|---|
| 440 | 426 | if (size < 0) |
|---|
| 441 | 427 | size = 8; |
|---|
| 442 | 428 | put_unaligned_be64(i_size_read(ecryptfs_inode), xattr_virt); |
|---|
| .. | .. |
|---|
| 538 | 524 | |
|---|
| 539 | 525 | static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) |
|---|
| 540 | 526 | { |
|---|
| 541 | | - int rc = 0; |
|---|
| 542 | | - struct inode *inode; |
|---|
| 543 | | - struct inode *lower_inode; |
|---|
| 527 | + struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host); |
|---|
| 528 | + int ret = bmap(lower_inode, &block); |
|---|
| 544 | 529 | |
|---|
| 545 | | - inode = (struct inode *)mapping->host; |
|---|
| 546 | | - lower_inode = ecryptfs_inode_to_lower(inode); |
|---|
| 547 | | - if (lower_inode->i_mapping->a_ops->bmap) |
|---|
| 548 | | - rc = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping, |
|---|
| 549 | | - block); |
|---|
| 550 | | - return rc; |
|---|
| 530 | + if (ret) |
|---|
| 531 | + return 0; |
|---|
| 532 | + return block; |
|---|
| 551 | 533 | } |
|---|
| 552 | 534 | |
|---|
| 553 | 535 | const struct address_space_operations ecryptfs_aops = { |
|---|