aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-25 11:51:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-25 11:51:57 -0400
commit25f6a53799d667283d3bee29a6ac75ae3dae38dc (patch)
tree9af7509d3ab1ddce7e5a5672cbd7aa3ca5d27c6f
parenta9d0683e0b62b46c7a5d0ebd8f642d8f9a4b7b32 (diff)
parentf070e5ac9bc7de71c34402048ce5526dccbd347c (diff)
Merge tag 'jfs-4.13' of git://github.com/kleikamp/linux-shaggy
Pull JFS fixes from David Kleikamp. * tag 'jfs-4.13' of git://github.com/kleikamp/linux-shaggy: jfs: preserve i_mode if __jfs_set_acl() fails jfs: Don't clear SGID when inheriting ACLs jfs: atomically read inode size
-rw-r--r--fs/jfs/acl.c24
-rw-r--r--fs/jfs/resize.c4
-rw-r--r--fs/jfs/super.c4
3 files changed, 20 insertions, 12 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 7bc186f4ed4d..2e71b6e7e646 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -77,13 +77,6 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
77 switch (type) { 77 switch (type) {
78 case ACL_TYPE_ACCESS: 78 case ACL_TYPE_ACCESS:
79 ea_name = XATTR_NAME_POSIX_ACL_ACCESS; 79 ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
80 if (acl) {
81 rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
82 if (rc)
83 return rc;
84 inode->i_ctime = current_time(inode);
85 mark_inode_dirty(inode);
86 }
87 break; 80 break;
88 case ACL_TYPE_DEFAULT: 81 case ACL_TYPE_DEFAULT:
89 ea_name = XATTR_NAME_POSIX_ACL_DEFAULT; 82 ea_name = XATTR_NAME_POSIX_ACL_DEFAULT;
@@ -115,12 +108,27 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
115{ 108{
116 int rc; 109 int rc;
117 tid_t tid; 110 tid_t tid;
111 int update_mode = 0;
112 umode_t mode = inode->i_mode;
118 113
119 tid = txBegin(inode->i_sb, 0); 114 tid = txBegin(inode->i_sb, 0);
120 mutex_lock(&JFS_IP(inode)->commit_mutex); 115 mutex_lock(&JFS_IP(inode)->commit_mutex);
116 if (type == ACL_TYPE_ACCESS && acl) {
117 rc = posix_acl_update_mode(inode, &mode, &acl);
118 if (rc)
119 goto end_tx;
120 update_mode = 1;
121 }
121 rc = __jfs_set_acl(tid, inode, type, acl); 122 rc = __jfs_set_acl(tid, inode, type, acl);
122 if (!rc) 123 if (!rc) {
124 if (update_mode) {
125 inode->i_mode = mode;
126 inode->i_ctime = current_time(inode);
127 mark_inode_dirty(inode);
128 }
123 rc = txCommit(tid, 1, &inode, 0); 129 rc = txCommit(tid, 1, &inode, 0);
130 }
131end_tx:
124 txEnd(tid); 132 txEnd(tid);
125 mutex_unlock(&JFS_IP(inode)->commit_mutex); 133 mutex_unlock(&JFS_IP(inode)->commit_mutex);
126 return rc; 134 return rc;
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index bd9b641ada2c..7ddcb445a3d9 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -98,7 +98,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
98 goto out; 98 goto out;
99 } 99 }
100 100
101 VolumeSize = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; 101 VolumeSize = i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits;
102 102
103 if (VolumeSize) { 103 if (VolumeSize) {
104 if (newLVSize > VolumeSize) { 104 if (newLVSize > VolumeSize) {
@@ -211,7 +211,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
211 txQuiesce(sb); 211 txQuiesce(sb);
212 212
213 /* Reset size of direct inode */ 213 /* Reset size of direct inode */
214 sbi->direct_inode->i_size = sb->s_bdev->bd_inode->i_size; 214 sbi->direct_inode->i_size = i_size_read(sb->s_bdev->bd_inode);
215 215
216 if (sbi->mntflag & JFS_INLINELOG) { 216 if (sbi->mntflag & JFS_INLINELOG) {
217 /* 217 /*
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index e8aad7d87b8c..78b41e1d5c67 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -313,7 +313,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
313 } 313 }
314 case Opt_resize_nosize: 314 case Opt_resize_nosize:
315 { 315 {
316 *newLVSize = sb->s_bdev->bd_inode->i_size >> 316 *newLVSize = i_size_read(sb->s_bdev->bd_inode) >>
317 sb->s_blocksize_bits; 317 sb->s_blocksize_bits;
318 if (*newLVSize == 0) 318 if (*newLVSize == 0)
319 pr_err("JFS: Cannot determine volume size\n"); 319 pr_err("JFS: Cannot determine volume size\n");
@@ -579,7 +579,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
579 goto out_unload; 579 goto out_unload;
580 } 580 }
581 inode->i_ino = 0; 581 inode->i_ino = 0;
582 inode->i_size = sb->s_bdev->bd_inode->i_size; 582 inode->i_size = i_size_read(sb->s_bdev->bd_inode);
583 inode->i_mapping->a_ops = &jfs_metapage_aops; 583 inode->i_mapping->a_ops = &jfs_metapage_aops;
584 hlist_add_fake(&inode->i_hash); 584 hlist_add_fake(&inode->i_hash);
585 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); 585 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);