Skip to content

Commit 465b0db

Browse files
committed
Merge tag 'for-f2fs-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs fixes from Jaegeuk Kim: "We've filed some bug fixes: - missing f2fs case in terms of stale SGID bit, introduced by Jan - build error for seq_file.h - avoid cpu lockup - wrong inode_unlock in error case" * tag 'for-f2fs-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: f2fs: avoid cpu lockup f2fs: include seq_file.h for sysfs.c f2fs: Don't clear SGID when inheriting ACLs f2fs: remove extra inode_unlock() in error path
2 parents f58781c + 4db08d0 commit 465b0db

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

fs/f2fs/acl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
211211
switch (type) {
212212
case ACL_TYPE_ACCESS:
213213
name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
214-
if (acl) {
214+
if (acl && !ipage) {
215215
error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
216216
if (error)
217217
return error;

fs/f2fs/checkpoint.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
879879
struct inode *inode;
880880
struct f2fs_inode_info *fi;
881881
bool is_dir = (type == DIR_INODE);
882+
unsigned long ino = 0;
882883

883884
trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
884885
get_pages(sbi, is_dir ?
@@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
901902
inode = igrab(&fi->vfs_inode);
902903
spin_unlock(&sbi->inode_lock[type]);
903904
if (inode) {
905+
unsigned long cur_ino = inode->i_ino;
906+
904907
filemap_fdatawrite(inode->i_mapping);
905908
iput(inode);
909+
/* We need to give cpu to another writers. */
910+
if (ino == cur_ino) {
911+
congestion_wait(BLK_RW_ASYNC, HZ/50);
912+
cond_resched();
913+
} else {
914+
ino = cur_ino;
915+
}
906916
} else {
907917
/*
908918
* We should submit bio, since it exists several

fs/f2fs/file.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
15381538

15391539
/* Is it quota file? Do not allow user to mess with it */
15401540
if (IS_NOQUOTA(inode)) {
1541-
inode_unlock(inode);
15421541
ret = -EPERM;
15431542
goto unlock_out;
15441543
}
@@ -1549,9 +1548,8 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
15491548

15501549
if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) {
15511550
if (!capable(CAP_LINUX_IMMUTABLE)) {
1552-
inode_unlock(inode);
15531551
ret = -EPERM;
1554-
goto out;
1552+
goto unlock_out;
15551553
}
15561554
}
15571555

@@ -1564,7 +1562,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
15641562
f2fs_mark_inode_dirty_sync(inode, false);
15651563
unlock_out:
15661564
inode_unlock(inode);
1567-
out:
15681565
mnt_drop_write_file(filp);
15691566
return ret;
15701567
}

fs/f2fs/sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
#include <linux/proc_fs.h>
1313
#include <linux/f2fs_fs.h>
14+
#include <linux/seq_file.h>
1415

1516
#include "f2fs.h"
1617
#include "segment.h"

0 commit comments

Comments
 (0)