hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/ecryptfs/mmap.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /**
23 * eCryptfs: Linux filesystem encryption layer
34 * This is where eCryptfs coordinates the symmetric encryption and
....@@ -8,21 +9,6 @@
89 * Copyright (C) 2001-2003 Stony Brook University
910 * Copyright (C) 2004-2007 International Business Machines Corp.
1011 * 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.
2612 */
2713
2814 #include <linux/pagemap.h>
....@@ -436,7 +422,7 @@
436422 }
437423 inode_lock(lower_inode);
438424 size = __vfs_getxattr(lower_dentry, lower_inode, ECRYPTFS_XATTR_NAME,
439
- xattr_virt, PAGE_SIZE);
425
+ xattr_virt, PAGE_SIZE, XATTR_NOSECURITY);
440426 if (size < 0)
441427 size = 8;
442428 put_unaligned_be64(i_size_read(ecryptfs_inode), xattr_virt);
....@@ -538,16 +524,12 @@
538524
539525 static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
540526 {
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);
544529
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;
551533 }
552534
553535 const struct address_space_operations ecryptfs_aops = {