Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec3c7a7a authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Merge android-4.14 (e6fa8a20) into msm-4.14



* refs/heads/tmp-e6fa8a20:
  Revert "f2fs: fix to propagate return value of scan_nat_page()"
  Revert "f2fs: fix to propagate error from __get_meta_page()"
  Revert "f2fs: use timespec64 for inode timestamps"
  f2fs: readahead encrypted block during GC
  f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc
  f2fs: fix performance issue observed with multi-thread sequential read
  f2fs: fix to skip verifying block address for non-regular inode
  f2fs: rework fault injection handling to avoid a warning
  f2fs: support fault_type mount option
  f2fs: fix to return success when trimming meta area
  f2fs: fix use-after-free of dicard command entry
  f2fs: support discard submission error injection
  f2fs: split discard command in prior to block layer
  f2fs: wake up gc thread immediately when gc_urgent is set
  f2fs: fix incorrect range->len in f2fs_trim_fs()
  f2fs: refresh recent accessed nat entry in lru list
  f2fs: fix avoid race between truncate and background GC
  f2fs: avoid race between zero_range and background GC
  f2fs: fix to do sanity check with block address in main area v2
  f2fs: fix to do sanity check with inline flags
  f2fs: fix to reset i_gc_failures correctly
  f2fs: fix invalid memory access
  f2fs: fix to avoid broken of dnode block list
  f2fs: use true and false for boolean values
  f2fs: fix to do sanity check with cp_pack_start_sum
  f2fs: avoid f2fs_bug_on() in cp_error case
  f2fs: fix to clear PG_checked flag in set_page_dirty()
  f2fs: fix to active page in lru list for read path
  f2fs: don't keep meta pages used for block migration
  f2fs: fix to restrict mount condition when without CONFIG_QUOTA
  f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled
  f2fs: quota: fix incorrect comments
  f2fs: quota: decrease the lock granularity of statfs_project
  f2fs: add proc entry to show victim_secmap bitmap
  f2fs: let checkpoint flush dnode page of regular
  f2fs: issue discard align to section in LFS mode
  f2fs: don't allow any writes on aborted atomic writes
  f2fs: restrict setting up inode.i_advise
  f2fs: fix wrong kernel message when recover fsync data on ro fs
  f2fs: clean up ioctl interface naming
  f2fs: clean up with f2fs_is_{atomic,volatile}_file()
  f2fs: clean up with f2fs_encrypted_inode()
  f2fs: clean up with get_current_nat_page
  f2fs: kill EXT_TREE_VEC_SIZE
  f2fs: avoid duplicated permission check for "trusted." xattrs
  f2fs: fix to propagate error from __get_meta_page()
  f2fs: fix to do sanity check with i_extra_isize
  f2fs: blk_finish_plug of submit_bio in lfs mode
  f2fs: do not set free of current section
  f2fs: Keep alloc_valid_block_count in sync
  f2fs: issue small discard by LBA order
  f2fs: stop issuing discard immediately if there is queued IO
  f2fs: clean up with IS_INODE()
  f2fs: detect bug_on in f2fs_wait_discard_bios
  f2fs: fix defined but not used build warnings
  f2fs: enable real-time discard by default
  f2fs: fix to detect looped node chain correctly
  f2fs: fix to do sanity check with block address in main area
  f2fs: fix to skip GC if type in SSA and SIT is inconsistent
  f2fs: try grabbing node page lock aggressively in sync scenario
  f2fs: show the fsync_mode=nobarrier mount option
  f2fs: check the right return value of memory alloc function
  f2fs: Replace strncpy with memcpy
  f2fs: avoid the global name 'fault_name'
  f2fs: fix to do sanity check with reserved blkaddr of inline inode
  f2fs: fix to do sanity check with node footer and iblocks
  f2fs: Allocate and stat mem used by free nid bitmap more accurately
  f2fs: fix to do sanity check with user_block_count
  f2fs: fix to do sanity check with extra_attr feature
  f2fs: fix to correct return value of f2fs_trim_fs
  f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize
  f2fs: fix to do sanity check with secs_per_zone
  f2fs: disable f2fs_check_rb_tree_consistence
  f2fs: introduce and spread verify_blkaddr
  f2fs: use timespec64 for inode timestamps
  f2fs: fix to wait on page writeback before updating page
  f2fs: assign REQ_RAHEAD to bio for ->readpages
  f2fs: fix a hungtask problem caused by congestion_wait
  f2fs: Fix uninitialized return in f2fs_ioc_shutdown()
  f2fs: don't issue discard commands in online discard is on
  f2fs: fix to propagate return value of scan_nat_page()
  f2fs: support in-memory inode checksum when checking consistency
  f2fs: fix error path of fill_super
  f2fs: relocate readdir_ra configure initialization
  f2fs: move s_res{u,g}id initialization to default_options()
  f2fs: don't acquire orphan ino during recovery
  f2fs: avoid potential deadlock in f2fs_sbi_store
  f2fs: indicate shutdown f2fs to allow unmount successfully
  f2fs: keep meta pages in cp_error state
  f2fs: do checkpoint in kill_sb
  f2fs: allow wrong configured dio to buffered write
  f2fs: flush journal nat entries for nat_bits during unmount

Conflicts:
	fs/f2fs/checkpoint.c
	fs/f2fs/data.c
	fs/f2fs/f2fs.h
	fs/f2fs/inode.c
	fs/f2fs/node.c
	fs/f2fs/segment.c

Change-Id: I31b0b06129b4da71477592e4699b4703504cea17
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parents 3773b3a5 d44e71e8
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -157,6 +157,24 @@ data_flush Enable data flushing before checkpoint in order to
                       persist data of regular and symlink.
fault_injection=%d     Enable fault injection in all supported types with
                       specified injection rate.
fault_type=%d          Support configuring fault injection type, should be
                       enabled with fault_injection option, fault type value
                       is shown below, it supports single or combined type.
                       Type_Name		Type_Value
                       FAULT_KMALLOC		0x000000001
                       FAULT_KVMALLOC		0x000000002
                       FAULT_PAGE_ALLOC		0x000000004
                       FAULT_PAGE_GET		0x000000008
                       FAULT_ALLOC_BIO		0x000000010
                       FAULT_ALLOC_NID		0x000000020
                       FAULT_ORPHAN		0x000000040
                       FAULT_BLOCK		0x000000080
                       FAULT_DIR_DEPTH		0x000000100
                       FAULT_EVICT_INODE	0x000000200
                       FAULT_TRUNCATE		0x000000400
                       FAULT_IO			0x000000800
                       FAULT_CHECKPOINT		0x000001000
                       FAULT_DISCARD		0x000002000
mode=%s                Control block allocation mode which supports "adaptive"
                       and "lfs". In "lfs" mode, there should be no random
                       writes towards main area.
+34 −31
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ struct kmem_cache *f2fs_inode_entry_slab;

void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
{
	f2fs_build_fault_attr(sbi, 0, 0);
	set_ckpt_flags(sbi, CP_ERROR_FLAG);
	if (!end_io)
		f2fs_flush_merged_writes(sbi);
@@ -267,11 +268,8 @@ static int __f2fs_write_meta_page(struct page *page,

	trace_f2fs_writepage(page, META);

	if (unlikely(f2fs_cp_error(sbi))) {
		dec_page_count(sbi, F2FS_DIRTY_META);
		unlock_page(page);
		return 0;
	}
	if (unlikely(f2fs_cp_error(sbi)))
		goto redirty_out;
	if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
		goto redirty_out;
	if (wbc->for_reclaim && page->index < GET_SUM_BLOCK(sbi, 0))
@@ -554,13 +552,12 @@ int f2fs_acquire_orphan_inode(struct f2fs_sb_info *sbi)

	spin_lock(&im->ino_lock);

#ifdef CONFIG_F2FS_FAULT_INJECTION
	if (time_to_inject(sbi, FAULT_ORPHAN)) {
		spin_unlock(&im->ino_lock);
		f2fs_show_injection_info(FAULT_ORPHAN);
		return -ENOSPC;
	}
#endif

	if (unlikely(im->ino_num >= sbi->max_orphans))
		err = -ENOSPC;
	else
@@ -597,12 +594,7 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
{
	struct inode *inode;
	struct node_info ni;
	int err = f2fs_acquire_orphan_inode(sbi);

	if (err)
		goto err_out;

	__add_ino_entry(sbi, ino, 0, ORPHAN_INO);
	int err;

	inode = f2fs_iget_retry(sbi->sb, ino);
	if (IS_ERR(inode)) {
@@ -634,7 +626,6 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
		err = -EIO;
		goto err_out;
	}
	__remove_ino_entry(sbi, ino, ORPHAN_INO);
	return 0;

err_out:
@@ -666,7 +657,10 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
	/* Needed for iput() to work correctly and not trash data */
	sbi->sb->s_flags |= MS_ACTIVE;

	/* Turn on quotas so that they are updated correctly */
	/*
	 * Turn on quotas which were not enabled for read-only mounts if
	 * filesystem has quota feature, so that they are updated correctly.
	 */
	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & MS_RDONLY);
#endif

@@ -1027,12 +1021,10 @@ int f2fs_sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)

		iput(inode);
		/* We need to give cpu to another writers. */
		if (ino == cur_ino) {
			congestion_wait(BLK_RW_ASYNC, HZ/50);
		if (ino == cur_ino)
			cond_resched();
		} else {
		else
			ino = cur_ino;
		}
	} else {
		/*
		 * We should submit bio, since it exists several
@@ -1166,7 +1158,7 @@ static void unblock_operations(struct f2fs_sb_info *sbi)
	f2fs_unlock_all(sbi);
}

static void wait_on_all_pages_writeback(struct f2fs_sb_info *sbi)
void f2fs_wait_on_all_pages_writeback(struct f2fs_sb_info *sbi)
{
	DEFINE_WAIT(wait);

@@ -1176,6 +1168,9 @@ static void wait_on_all_pages_writeback(struct f2fs_sb_info *sbi)
		if (!get_pages(sbi, F2FS_WB_CP_DATA))
			break;

		if (unlikely(f2fs_cp_error(sbi)))
			break;

		io_schedule_timeout(5*HZ);
	}
	finish_wait(&sbi->cp_wait, &wait);
@@ -1249,8 +1244,12 @@ static void commit_checkpoint(struct f2fs_sb_info *sbi,

	/* writeout cp pack 2 page */
	err = __f2fs_write_meta_page(page, &wbc, FS_CP_META_IO);
	f2fs_bug_on(sbi, err);
	if (unlikely(err && f2fs_cp_error(sbi))) {
		f2fs_put_page(page, 1);
		return;
	}

	f2fs_bug_on(sbi, err);
	f2fs_put_page(page, 0);

	/* submit checkpoint (with barrier if NOBARRIER is not set) */
@@ -1276,7 +1275,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
	while (get_pages(sbi, F2FS_DIRTY_META)) {
		f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
		if (unlikely(f2fs_cp_error(sbi)))
			return -EIO;
			break;
	}

	/*
@@ -1356,7 +1355,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
			f2fs_sync_meta_pages(sbi, META, LONG_MAX,
							FS_CP_META_IO);
			if (unlikely(f2fs_cp_error(sbi)))
				return -EIO;
				break;
		}
	}

@@ -1395,10 +1394,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
	f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);

	/* wait for previous submitted meta pages writeback */
	wait_on_all_pages_writeback(sbi);

	if (unlikely(f2fs_cp_error(sbi)))
		return -EIO;
	f2fs_wait_on_all_pages_writeback(sbi);

	/* flush all device cache */
	err = f2fs_flush_device_cache(sbi);
@@ -1407,12 +1403,19 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)

	/* barrier and flush checkpoint cp pack 2 page if it can */
	commit_checkpoint(sbi, ckpt, start_blk);
	wait_on_all_pages_writeback(sbi);
	f2fs_wait_on_all_pages_writeback(sbi);

	/*
	 * invalidate intermediate page cache borrowed from meta inode
	 * which are used for migration of encrypted inode's blocks.
	 */
	if (f2fs_sb_has_encrypt(sbi->sb))
		invalidate_mapping_pages(META_MAPPING(sbi),
				MAIN_BLKADDR(sbi), MAX_BLKADDR(sbi) - 1);

	f2fs_release_ino_entry(sbi, false);

	if (unlikely(f2fs_cp_error(sbi)))
		return -EIO;
	f2fs_reset_fsync_node_info(sbi);

	clear_sbi_flag(sbi, SBI_IS_DIRTY);
	clear_sbi_flag(sbi, SBI_NEED_CP);
@@ -1428,7 +1431,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)

	f2fs_bug_on(sbi, get_pages(sbi, F2FS_DIRTY_DENTS));

	return 0;
	return unlikely(f2fs_cp_error(sbi)) ? -EIO : 0;
}

/*
+62 −32
Original line number Diff line number Diff line
@@ -127,12 +127,10 @@ static bool f2fs_bio_post_read_required(struct bio *bio)

static void f2fs_read_end_io(struct bio *bio)
{
#ifdef CONFIG_F2FS_FAULT_INJECTION
	if (time_to_inject(F2FS_P_SB(bio->bi_io_vec->bv_page), FAULT_IO)) {
		f2fs_show_injection_info(FAULT_IO);
		bio->bi_status = BLK_STS_IOERR;
	}
#endif

	if (f2fs_bio_post_read_required(bio)) {
		struct bio_post_read_ctx *ctx = bio->bi_private;
@@ -178,6 +176,8 @@ static void f2fs_write_end_io(struct bio *bio)
					page->index != nid_of_node(page));

		dec_page_count(sbi, type);
		if (f2fs_in_warm_node_list(sbi, page))
			f2fs_del_fsync_node_entry(sbi, page);
		clear_cold_data(page);
		end_page_writeback(page);
	}
@@ -265,7 +265,7 @@ static inline void __submit_bio(struct f2fs_sb_info *sbi,
		if (type != DATA && type != NODE)
			goto submit_io;

		if (f2fs_sb_has_blkzoned(sbi->sb) && current->plug)
		if (test_opt(sbi, LFS) && current->plug)
			blk_finish_plug(current->plug);

		start = bio->bi_iter.bi_size >> F2FS_BLKSIZE_BITS;
@@ -561,7 +561,7 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio)
}

static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
							 unsigned nr_pages)
					unsigned nr_pages, unsigned op_flag)
{
	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
	struct bio *bio;
@@ -579,7 +579,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
	bio_set_op_attrs(bio, REQ_OP_READ,
			 (f2fs_encrypted_inode(inode) ?
			  REQ_NOENCRYPT :
			  0));
			  op_flag));

	if (f2fs_encrypted_file(inode) &&
		!fscrypt_using_hardware_encryption(inode))
@@ -602,7 +602,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
static int f2fs_submit_page_read(struct inode *inode, struct page *page,
							block_t blkaddr)
{
	struct bio *bio = f2fs_grab_read_bio(inode, blkaddr, 1);
	struct bio *bio = f2fs_grab_read_bio(inode, blkaddr, 1, 0);

	if (IS_ERR(bio))
		return PTR_ERR(bio);
@@ -906,6 +906,7 @@ static int __allocate_data_block(struct dnode_of_data *dn, int seg_type)
	struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode);
	struct f2fs_summary sum;
	struct node_info ni;
	block_t old_blkaddr;
	pgoff_t fofs;
	blkcnt_t count = 1;
	int err;
@@ -927,9 +928,12 @@ static int __allocate_data_block(struct dnode_of_data *dn, int seg_type)

alloc:
	set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);

	f2fs_allocate_data_block(sbi, NULL, dn->data_blkaddr, &dn->data_blkaddr,
	old_blkaddr = dn->data_blkaddr;
	f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr,
					&sum, seg_type, NULL, false);
	if (GET_SEGNO(sbi, old_blkaddr) != NULL_SEGNO)
		invalidate_mapping_pages(META_MAPPING(sbi),
					old_blkaddr, old_blkaddr);
	f2fs_set_data_blkaddr(dn);

	/* update i_size */
@@ -1476,10 +1480,15 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
/*
 * This function was originally taken from fs/mpage.c, and customized for f2fs.
 * Major change was from block_size == page_size in f2fs by default.
 *
 * Note that the aops->readpages() function is ONLY used for read-ahead. If
 * this function ever deviates from doing just read-ahead, it should either
 * use ->readpage() or do the necessary surgery to decouple ->readpages()
 * from read-ahead.
 */
static int f2fs_mpage_readpages(struct address_space *mapping,
			struct list_head *pages, struct page *page,
			unsigned nr_pages)
			unsigned nr_pages, bool is_readahead)
{
	struct bio *bio = NULL;
	sector_t last_block_in_bio = 0;
@@ -1583,7 +1592,8 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
		}

		if (bio == NULL) {
			bio = f2fs_grab_read_bio(inode, block_nr, nr_pages);
			bio = f2fs_grab_read_bio(inode, block_nr, nr_pages,
					is_readahead ? REQ_RAHEAD : 0);
			if (IS_ERR(bio)) {
				bio = NULL;
				goto set_error_page;
@@ -1634,7 +1644,7 @@ static int f2fs_read_data_page(struct file *file, struct page *page)
	if (f2fs_has_inline_data(inode))
		ret = f2fs_read_inline_data(inode, page);
	if (ret == -EAGAIN)
		ret = f2fs_mpage_readpages(page->mapping, NULL, page, 1);
		ret = f2fs_mpage_readpages(page->mapping, NULL, page, 1, false);
	return ret;
}

@@ -1651,12 +1661,13 @@ static int f2fs_read_data_pages(struct file *file,
	if (f2fs_has_inline_data(inode))
		return 0;

	return f2fs_mpage_readpages(mapping, pages, NULL, nr_pages);
	return f2fs_mpage_readpages(mapping, pages, NULL, nr_pages, true);
}

static int encrypt_one_page(struct f2fs_io_info *fio)
{
	struct inode *inode = fio->page->mapping->host;
	struct page *mpage;
	gfp_t gfp_flags = GFP_NOFS;

	if (!f2fs_encrypted_file(inode))
@@ -1671,9 +1682,7 @@ static int encrypt_one_page(struct f2fs_io_info *fio)

	fio->encrypted_page = fscrypt_encrypt_page(inode, fio->page,
			PAGE_SIZE, 0, fio->page->index, gfp_flags);
	if (!IS_ERR(fio->encrypted_page))
		return 0;

	if (IS_ERR(fio->encrypted_page)) {
		/* flush pending IOs and wait for a while in the ENOMEM case */
		if (PTR_ERR(fio->encrypted_page) == -ENOMEM) {
			f2fs_flush_merged_writes(fio->sbi);
@@ -1684,6 +1693,16 @@ static int encrypt_one_page(struct f2fs_io_info *fio)
		return PTR_ERR(fio->encrypted_page);
	}

	mpage = find_lock_page(META_MAPPING(fio->sbi), fio->old_blkaddr);
	if (mpage) {
		if (PageUptodate(mpage))
			memcpy(page_address(mpage),
				page_address(fio->encrypted_page), PAGE_SIZE);
		f2fs_put_page(mpage, 1);
	}
	return 0;
}

static inline bool check_inplace_update_policy(struct inode *inode,
				struct f2fs_io_info *fio)
{
@@ -2263,10 +2282,14 @@ static void f2fs_write_failed(struct address_space *mapping, loff_t to)
	loff_t i_size = i_size_read(inode);

	if (to > i_size) {
		down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
		down_write(&F2FS_I(inode)->i_mmap_sem);

		truncate_pagecache(inode, i_size);
		f2fs_truncate_blocks(inode, i_size, true);

		up_write(&F2FS_I(inode)->i_mmap_sem);
		up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
	}
}

@@ -2379,8 +2402,9 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
	}
	trace_f2fs_write_begin(inode, pos, len, flags);

	if (f2fs_is_atomic_file(inode) &&
			!f2fs_available_free_memory(sbi, INMEM_PAGES)) {
	if ((f2fs_is_atomic_file(inode) &&
			!f2fs_available_free_memory(sbi, INMEM_PAGES)) ||
			is_inode_flag_set(inode, FI_ATOMIC_REVOKE_REQUEST)) {
		err = -ENOMEM;
		drop_atomic = true;
		goto fail;
@@ -2501,14 +2525,20 @@ static int f2fs_write_end(struct file *file,
static int check_direct_IO(struct inode *inode, struct iov_iter *iter,
			   loff_t offset)
{
	unsigned blocksize_mask = inode->i_sb->s_blocksize - 1;

	if (offset & blocksize_mask)
		return -EINVAL;

	if (iov_iter_alignment(iter) & blocksize_mask)
	unsigned i_blkbits = READ_ONCE(inode->i_blkbits);
	unsigned blkbits = i_blkbits;
	unsigned blocksize_mask = (1 << blkbits) - 1;
	unsigned long align = offset | iov_iter_alignment(iter);
	struct block_device *bdev = inode->i_sb->s_bdev;

	if (align & blocksize_mask) {
		if (bdev)
			blkbits = blksize_bits(bdev_logical_block_size(bdev));
		blocksize_mask = (1 << blkbits) - 1;
		if (align & blocksize_mask)
			return -EINVAL;

		return 1;
	}
	return 0;
}

@@ -2526,7 +2556,7 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)

	err = check_direct_IO(inode, iter, offset);
	if (err)
		return err;
		return err < 0 ? err : 0;

	if (f2fs_force_buffered_io(inode, rw))
		return 0;
+2 −1
Original line number Diff line number Diff line
@@ -215,7 +215,8 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
	si->base_mem += sizeof(struct f2fs_nm_info);
	si->base_mem += __bitmap_size(sbi, NAT_BITMAP);
	si->base_mem += (NM_I(sbi)->nat_bits_blocks << F2FS_BLKSIZE_BITS);
	si->base_mem += NM_I(sbi)->nat_blocks * NAT_ENTRY_BITMAP_SIZE;
	si->base_mem += NM_I(sbi)->nat_blocks *
				f2fs_bitmap_size(NAT_ENTRY_PER_BLOCK);
	si->base_mem += NM_I(sbi)->nat_blocks / 8;
	si->base_mem += NM_I(sbi)->nat_blocks * sizeof(unsigned short);

+1 −2
Original line number Diff line number Diff line
@@ -517,12 +517,11 @@ int f2fs_add_regular_entry(struct inode *dir, const struct qstr *new_name,
	}

start:
#ifdef CONFIG_F2FS_FAULT_INJECTION
	if (time_to_inject(F2FS_I_SB(dir), FAULT_DIR_DEPTH)) {
		f2fs_show_injection_info(FAULT_DIR_DEPTH);
		return -ENOSPC;
	}
#endif

	if (unlikely(current_depth == MAX_DIR_HASH_DEPTH))
		return -ENOSPC;

Loading