aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 15:28:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 15:28:30 -0400
commite31fb9e00543e5d3c5b686747d3c862bc09b59f3 (patch)
tree4300b111471a858b542d55d47d587fb8ef52513a /fs/ocfs2/file.c
parent824b005c86f91fe02eb2743a4526361f11786f70 (diff)
parent9181f8bf5abf4b9d59b12e878895375b84fe32ba (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext3 removal, quota & udf fixes from Jan Kara: "The biggest change in the pull is the removal of ext3 filesystem driver (~28k lines removed). Ext4 driver is a full featured replacement these days and both RH and SUSE use it for several years without issues. Also there are some workarounds in VM & block layer mainly for ext3 which we could eventually get rid of. Other larger change is addition of proper error handling for dquot_initialize(). The rest is small fixes and cleanups" [ I wasn't convinced about the ext3 removal and worried about things falling through the cracks for legacy users, but ext4 maintainers piped up and were all unanimously in favor of removal, and maintaining all legacy ext3 support inside ext4. - Linus ] * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Don't modify filesystem for read-only mounts quota: remove an unneeded condition ext4: memory leak on error in ext4_symlink() mm/Kconfig: NEED_BOUNCE_POOL: clean-up condition ext4: Improve ext4 Kconfig test block: Remove forced page bouncing under IO fs: Remove ext3 filesystem driver doc: Update doc about journalling layer jfs: Handle error from dquot_initialize() reiserfs: Handle error from dquot_initialize() ocfs2: Handle error from dquot_initialize() ext4: Handle error from dquot_initialize() ext2: Handle error from dquot_initalize() quota: Propagate error from ->acquire_dquot()
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 719f7f4c7a37..7210583b472f 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -105,8 +105,11 @@ static int ocfs2_file_open(struct inode *inode, struct file *file)
105 file->f_path.dentry->d_name.len, 105 file->f_path.dentry->d_name.len,
106 file->f_path.dentry->d_name.name, mode); 106 file->f_path.dentry->d_name.name, mode);
107 107
108 if (file->f_mode & FMODE_WRITE) 108 if (file->f_mode & FMODE_WRITE) {
109 dquot_initialize(inode); 109 status = dquot_initialize(inode);
110 if (status)
111 goto leave;
112 }
110 113
111 spin_lock(&oi->ip_lock); 114 spin_lock(&oi->ip_lock);
112 115
@@ -1155,8 +1158,11 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1155 if (status) 1158 if (status)
1156 return status; 1159 return status;
1157 1160
1158 if (is_quota_modification(inode, attr)) 1161 if (is_quota_modification(inode, attr)) {
1159 dquot_initialize(inode); 1162 status = dquot_initialize(inode);
1163 if (status)
1164 return status;
1165 }
1160 size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE; 1166 size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE;
1161 if (size_change) { 1167 if (size_change) {
1162 status = ocfs2_rw_lock(inode, 1); 1168 status = ocfs2_rw_lock(inode, 1);
@@ -1209,8 +1215,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1209 && OCFS2_HAS_RO_COMPAT_FEATURE(sb, 1215 && OCFS2_HAS_RO_COMPAT_FEATURE(sb,
1210 OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) { 1216 OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) {
1211 transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid)); 1217 transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid));
1212 if (!transfer_to[USRQUOTA]) { 1218 if (IS_ERR(transfer_to[USRQUOTA])) {
1213 status = -ESRCH; 1219 status = PTR_ERR(transfer_to[USRQUOTA]);
1214 goto bail_unlock; 1220 goto bail_unlock;
1215 } 1221 }
1216 } 1222 }
@@ -1218,8 +1224,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1218 && OCFS2_HAS_RO_COMPAT_FEATURE(sb, 1224 && OCFS2_HAS_RO_COMPAT_FEATURE(sb,
1219 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) { 1225 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) {
1220 transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid)); 1226 transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid));
1221 if (!transfer_to[GRPQUOTA]) { 1227 if (IS_ERR(transfer_to[GRPQUOTA])) {
1222 status = -ESRCH; 1228 status = PTR_ERR(transfer_to[GRPQUOTA]);
1223 goto bail_unlock; 1229 goto bail_unlock;
1224 } 1230 }
1225 } 1231 }