Skip to content

Commit 94fc079

Browse files
committed
Merge tag 'fs_for_v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2, reiserfs, udf, and quota updates from Jan Kara: "A couple of small fixes and cleanups for ext2, udf, reiserfs, and quota. The biggest change is making CONFIG_PRINT_QUOTA_WARNING depend on BROKEN with an outlook for removing it completely in an year or so" * tag 'fs_for_v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: mark PRINT_QUOTA_WARNING as BROKEN quota: update Kconfig comment reiserfs: remove unused iter variable quota: Use register_sysctl_init() for registering fs_dqstats_table reiserfs: remove unused sched_count variable ext2: remove redundant assignment to pointer end quota: make dquot_set_dqinfo return errors from ->write_info quota: fixup *_write_file_info() to return proper error code quota: simplify two-level sysctl registration for fs_dqstats_table udf: use wrapper i_blocksize() in udf_discard_prealloc() udf: Use folios in udf_adinicb_writepage() ext2: Check block size validity during mount ext2: Correct maximum ext2 filesystem block size
2 parents 0cfcde1 + 36d532d commit 94fc079

File tree

11 files changed

+22
-39
lines changed

11 files changed

+22
-39
lines changed

fs/ext2/ext2.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
178178
* Macro-instructions used to manage several block sizes
179179
*/
180180
#define EXT2_MIN_BLOCK_SIZE 1024
181-
#define EXT2_MAX_BLOCK_SIZE 4096
181+
#define EXT2_MAX_BLOCK_SIZE 65536
182182
#define EXT2_MIN_BLOCK_LOG_SIZE 10
183+
#define EXT2_MAX_BLOCK_LOG_SIZE 16
183184
#define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize)
184185
#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
185186
#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)

fs/ext2/super.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
945945
goto failed_mount;
946946
}
947947

948+
if (le32_to_cpu(es->s_log_block_size) >
949+
(EXT2_MAX_BLOCK_LOG_SIZE - BLOCK_SIZE_BITS)) {
950+
ext2_msg(sb, KERN_ERR,
951+
"Invalid log block size: %u",
952+
le32_to_cpu(es->s_log_block_size));
953+
goto failed_mount;
954+
}
948955
blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
949956

950957
if (test_opt(sb, DAX)) {

fs/ext2/xattr.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
552552
error = -ENOMEM;
553553
if (header == NULL)
554554
goto cleanup;
555-
end = (char *)header + sb->s_blocksize;
556555
header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC);
557556
header->h_blocks = header->h_refcount = cpu_to_le32(1);
558557
last = here = ENTRY(header+1);

fs/quota/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config QUOTA
99
help
1010
If you say Y here, you will be able to set per user limits for disk
1111
usage (also called disk quotas). Currently, it works for the
12-
ext2, ext3, ext4, jfs, ocfs2 and reiserfs file systems.
12+
ext2, ext3, ext4, f2fs, jfs, ocfs2 and reiserfs file systems.
1313
Note that gfs2 and xfs use their own quota system.
1414
Ext3, ext4 and reiserfs also support journaled quotas for which
1515
you don't need to run quotacheck(8) after an unclean shutdown.
@@ -28,7 +28,7 @@ config QUOTA_NETLINK_INTERFACE
2828

2929
config PRINT_QUOTA_WARNING
3030
bool "Print quota warnings to console (OBSOLETE)"
31-
depends on QUOTA
31+
depends on QUOTA && BROKEN
3232
default y
3333
help
3434
If you say Y here, quota warnings (about exceeding softlimit, reaching

fs/quota/dquot.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,6 @@ EXPORT_SYMBOL(dquot_get_state);
28192819
int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii)
28202820
{
28212821
struct mem_dqinfo *mi;
2822-
int err = 0;
28232822

28242823
if ((ii->i_fieldmask & QC_WARNS_MASK) ||
28252824
(ii->i_fieldmask & QC_RT_SPC_TIMER))
@@ -2846,8 +2845,7 @@ int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii)
28462845
spin_unlock(&dq_data_lock);
28472846
mark_info_dirty(sb, type);
28482847
/* Force write to disk */
2849-
sb->dq_op->write_info(sb, type);
2850-
return err;
2848+
return sb->dq_op->write_info(sb, type);
28512849
}
28522850
EXPORT_SYMBOL(dquot_set_dqinfo);
28532851

@@ -2948,32 +2946,14 @@ static struct ctl_table fs_dqstats_table[] = {
29482946
{ },
29492947
};
29502948

2951-
static struct ctl_table fs_table[] = {
2952-
{
2953-
.procname = "quota",
2954-
.mode = 0555,
2955-
.child = fs_dqstats_table,
2956-
},
2957-
{ },
2958-
};
2959-
2960-
static struct ctl_table sys_table[] = {
2961-
{
2962-
.procname = "fs",
2963-
.mode = 0555,
2964-
.child = fs_table,
2965-
},
2966-
{ },
2967-
};
2968-
29692949
static int __init dquot_init(void)
29702950
{
29712951
int i, ret;
29722952
unsigned long nr_hash, order;
29732953

29742954
printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
29752955

2976-
register_sysctl_table(sys_table);
2956+
register_sysctl_init("fs/quota", fs_dqstats_table);
29772957

29782958
dquot_cachep = kmem_cache_create("dquot",
29792959
sizeof(struct dquot), sizeof(unsigned long) * 4,

fs/quota/quota_v1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static int v1_write_file_info(struct super_block *sb, int type)
206206
sizeof(struct v1_disk_dqblk), v1_dqoff(0));
207207
if (ret == sizeof(struct v1_disk_dqblk))
208208
ret = 0;
209-
else if (ret > 0)
209+
else if (ret >= 0)
210210
ret = -EIO;
211211
out:
212212
up_write(&dqopt->dqio_sem);

fs/quota/quota_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static int v2_write_file_info(struct super_block *sb, int type)
212212
up_write(&dqopt->dqio_sem);
213213
if (size != sizeof(struct v2_disk_dqinfo)) {
214214
quota_error(sb, "Can't write info structure");
215-
return -1;
215+
return size < 0 ? size : -EIO;
216216
}
217217
return 0;
218218
}

fs/reiserfs/journal.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,6 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
30313031
unsigned int old_trans_id;
30323032
struct reiserfs_journal *journal = SB_JOURNAL(sb);
30333033
struct reiserfs_transaction_handle myth;
3034-
int sched_count = 0;
30353034
int retval;
30363035
int depth;
30373036

@@ -3088,7 +3087,6 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
30883087
((journal->j_len + nblocks + 2) * 100) <
30893088
(journal->j_len_alloc * 75)) {
30903089
if (atomic_read(&journal->j_wcount) > 10) {
3091-
sched_count++;
30923090
queue_log_writer(sb);
30933091
goto relock;
30943092
}

fs/reiserfs/stree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,6 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
12621262

12631263
#ifdef CONFIG_REISERFS_CHECK
12641264
char mode;
1265-
int iter = 0;
12661265
#endif
12671266

12681267
BUG_ON(!th->t_trans_id);
@@ -1274,7 +1273,6 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
12741273
removed = 0;
12751274

12761275
#ifdef CONFIG_REISERFS_CHECK
1277-
iter++;
12781276
mode =
12791277
#endif
12801278
prepare_for_delete_or_cut(th, inode, path,

fs/udf/inode.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ static void udf_write_failed(struct address_space *mapping, loff_t to)
188188
static int udf_adinicb_writepage(struct folio *folio,
189189
struct writeback_control *wbc, void *data)
190190
{
191-
struct page *page = &folio->page;
192-
struct inode *inode = page->mapping->host;
191+
struct inode *inode = folio->mapping->host;
193192
struct udf_inode_info *iinfo = UDF_I(inode);
194193

195-
BUG_ON(!PageLocked(page));
196-
memcpy_from_page(iinfo->i_data + iinfo->i_lenEAttr, page, 0,
194+
BUG_ON(!folio_test_locked(folio));
195+
BUG_ON(folio->index != 0);
196+
memcpy_from_file_folio(iinfo->i_data + iinfo->i_lenEAttr, folio, 0,
197197
i_size_read(inode));
198-
unlock_page(page);
198+
folio_unlock(folio);
199199
mark_inode_dirty(inode);
200200

201201
return 0;

0 commit comments

Comments
 (0)