All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/32] bcachefs - a new COW filesystem
@ 2023-05-09 16:56 Kent Overstreet
  2023-05-09 16:56 ` [PATCH 01/32] Compiler Attributes: add __flatten Kent Overstreet
                   ` (32 more replies)
  0 siblings, 33 replies; 208+ messages in thread
From: Kent Overstreet @ 2023-05-09 16:56 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-block, linux-mm,
	linux-bcachefs
  Cc: Kent Overstreet, viro, akpm, boqun.feng, brauner, hch, colyli,
	djwong, mingo, jack, axboe, willy, ojeda, ming.lei, ndesaulniers,
	peterz, phillip, urezki, longman, will

I'm submitting the bcachefs filesystem for review and inclusion.

Included in this patch series are all the non fs/bcachefs/ patches. The
entire tree, based on v6.3, may be found at:

  http://evilpiepirate.org/git/bcachefs.git bcachefs-for-upstream

----------------------------------------------------------------

bcachefs overview, status:

Features:
 - too many to list

Known bugs:
 - too many to list

Status:
 - Snapshots have been declared stable; one serious bug report
   outstanding to look into, most users report it working well.

   These are RW btrfs-style snapshots, but with far better scalability
   and no scalability issues with sparse snapshots due to key level
   versioning.

 - Erasure coding is getting really close; hope to have it ready for
   users to beat on it by this summer. This is a novel RAID/erasure
   coding design with no write hole, and no fragmentation of writes
   (e.g. RAIDZ).

 - Tons of scalabality work finished over the past year, users are
   running it on 100 TB filesystems without complaint, waiting for first
   1 PB user; next thing to address re: scalability is fsck/recovery
   memory usage.

 - Test infrastructure! Major project milestone, check out our test
   dashboard at
     https://evilpiepirate.org/~testdashboard/ci?branch=bcachefs

Other project notes:

irc::/irc.oftc.net/bcache is where most activity happens; I'm always
there, and most code review happens there - I find the conversational
format more productive.

------------------------------------------------

patches in this series:

Christopher James Halse Rogers (1):
  stacktrace: Export stack_trace_save_tsk

Daniel Hill (1):
  lib: add mean and variance module.

Dave Chinner (3):
  vfs: factor out inode hash head calculation
  hlist-bl: add hlist_bl_fake()
  vfs: inode cache conversion to hash-bl

Kent Overstreet (27):
  Compiler Attributes: add __flatten
  locking/lockdep: lock_class_is_held()
  locking/lockdep: lockdep_set_no_check_recursion()
  locking: SIX locks (shared/intent/exclusive)
  MAINTAINERS: Add entry for six locks
  sched: Add task_struct->faults_disabled_mapping
  mm: Bring back vmalloc_exec
  fs: factor out d_mark_tmpfile()
  block: Add some exports for bcachefs
  block: Allow bio_iov_iter_get_pages() with bio->bi_bdev unset
  block: Bring back zero_fill_bio_iter
  block: Rework bio_for_each_segment_all()
  block: Rework bio_for_each_folio_all()
  block: Don't block on s_umount from __invalidate_super()
  bcache: move closures to lib/
  MAINTAINERS: Add entry for closures
  closures: closure_wait_event()
  closures: closure_nr_remaining()
  closures: Add a missing include
  iov_iter: copy_folio_from_iter_atomic()
  MAINTAINERS: Add entry for generic-radix-tree
  lib/generic-radix-tree.c: Don't overflow in peek()
  lib/generic-radix-tree.c: Add a missing include
  lib/generic-radix-tree.c: Add peek_prev()
  lib/string_helpers: string_get_size() now returns characters wrote
  lib: Export errname
  MAINTAINERS: Add entry for bcachefs

 MAINTAINERS                                   |  39 +
 block/bdev.c                                  |   2 +-
 block/bio.c                                   |  57 +-
 block/blk-core.c                              |   1 +
 block/blk-map.c                               |  38 +-
 block/blk.h                                   |   1 -
 block/bounce.c                                |  12 +-
 drivers/md/bcache/Kconfig                     |  10 +-
 drivers/md/bcache/Makefile                    |   4 +-
 drivers/md/bcache/bcache.h                    |   2 +-
 drivers/md/bcache/btree.c                     |   8 +-
 drivers/md/bcache/super.c                     |   1 -
 drivers/md/bcache/util.h                      |   3 +-
 drivers/md/dm-crypt.c                         |  10 +-
 drivers/md/raid1.c                            |   4 +-
 fs/btrfs/disk-io.c                            |   4 +-
 fs/btrfs/extent_io.c                          |  50 +-
 fs/btrfs/raid56.c                             |  14 +-
 fs/crypto/bio.c                               |   9 +-
 fs/dcache.c                                   |  12 +-
 fs/erofs/zdata.c                              |   4 +-
 fs/ext4/page-io.c                             |   8 +-
 fs/ext4/readpage.c                            |   4 +-
 fs/f2fs/data.c                                |  20 +-
 fs/gfs2/lops.c                                |  10 +-
 fs/gfs2/meta_io.c                             |   8 +-
 fs/inode.c                                    | 218 +++--
 fs/iomap/buffered-io.c                        |  14 +-
 fs/mpage.c                                    |   4 +-
 fs/squashfs/block.c                           |  48 +-
 fs/squashfs/lz4_wrapper.c                     |  17 +-
 fs/squashfs/lzo_wrapper.c                     |  17 +-
 fs/squashfs/xz_wrapper.c                      |  19 +-
 fs/squashfs/zlib_wrapper.c                    |  18 +-
 fs/squashfs/zstd_wrapper.c                    |  19 +-
 fs/super.c                                    |  40 +-
 fs/verity/verify.c                            |   9 +-
 include/linux/bio.h                           | 132 +--
 include/linux/blkdev.h                        |   1 +
 include/linux/bvec.h                          |  70 +-
 .../md/bcache => include/linux}/closure.h     |  46 +-
 include/linux/compiler_attributes.h           |   5 +
 include/linux/dcache.h                        |   1 +
 include/linux/fs.h                            |  10 +-
 include/linux/generic-radix-tree.h            |  68 +-
 include/linux/list_bl.h                       |  22 +
 include/linux/lockdep.h                       |  10 +
 include/linux/lockdep_types.h                 |   2 +-
 include/linux/mean_and_variance.h             | 219 +++++
 include/linux/sched.h                         |   1 +
 include/linux/six.h                           | 210 +++++
 include/linux/string_helpers.h                |   4 +-
 include/linux/uio.h                           |   2 +
 include/linux/vmalloc.h                       |   1 +
 init/init_task.c                              |   1 +
 kernel/Kconfig.locks                          |   3 +
 kernel/locking/Makefile                       |   1 +
 kernel/locking/lockdep.c                      |  46 ++
 kernel/locking/six.c                          | 779 ++++++++++++++++++
 kernel/module/main.c                          |   4 +-
 kernel/stacktrace.c                           |   2 +
 lib/Kconfig                                   |   3 +
 lib/Kconfig.debug                             |  18 +
 lib/Makefile                                  |   2 +
 {drivers/md/bcache => lib}/closure.c          |  36 +-
 lib/errname.c                                 |   1 +
 lib/generic-radix-tree.c                      |  76 +-
 lib/iov_iter.c                                |  53 +-
 lib/math/Kconfig                              |   3 +
 lib/math/Makefile                             |   2 +
 lib/math/mean_and_variance.c                  | 136 +++
 lib/math/mean_and_variance_test.c             | 155 ++++
 lib/string_helpers.c                          |   8 +-
 mm/nommu.c                                    |  18 +
 mm/vmalloc.c                                  |  21 +
 75 files changed, 2485 insertions(+), 445 deletions(-)
 rename {drivers/md/bcache => include/linux}/closure.h (93%)
 create mode 100644 include/linux/mean_and_variance.h
 create mode 100644 include/linux/six.h
 create mode 100644 kernel/locking/six.c
 rename {drivers/md/bcache => lib}/closure.c (88%)
 create mode 100644 lib/math/mean_and_variance.c
 create mode 100644 lib/math/mean_and_variance_test.c

-- 
2.40.1


^ permalink raw reply	[flat|nested] 208+ messages in thread
* Re: [PATCH 22/32] vfs: inode cache conversion to hash-bl
@ 2023-05-10 19:55 kernel test robot
  0 siblings, 0 replies; 208+ messages in thread
From: kernel test robot @ 2023-05-10 19:55 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230509165657.1735798-23-kent.overstreet@linux.dev>
References: <20230509165657.1735798-23-kent.overstreet@linux.dev>
TO: Kent Overstreet <kmo@daterainc.com>
TO: linux-kernel@vger.kernel.org
TO: linux-fsdevel@vger.kernel.org
TO: linux-bcachefs@vger.kernel.org
CC: Dave Chinner <dchinner@redhat.com>
CC: Alexander Viro <viro@zeniv.linux.org.uk>
CC: Christian Brauner <brauner@kernel.org>
CC: Kent Overstreet <kmo@daterainc.com>

Hi Kent,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/locking/core]
[cannot apply to axboe-block/for-next akpm-mm/mm-everything kdave/for-next linus/master v6.4-rc1 next-20230510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kent-Overstreet/Compiler-Attributes-add-__flatten/20230510-010302
base:   tip/locking/core
patch link:    https://lore.kernel.org/r/20230509165657.1735798-23-kent.overstreet%40linux.dev
patch subject: [PATCH 22/32] vfs: inode cache conversion to hash-bl
:::::: branch date: 27 hours ago
:::::: commit date: 27 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20230511/202305110304.n2TEQd6l-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202305110304.n2TEQd6l-lkp@intel.com/

New smatch warnings:
fs/inode.c:1232 inode_insert5() warn: sleeping in atomic context
fs/inode.c:1331 iget_locked() warn: sleeping in atomic context
fs/inode.c:1543 ilookup() warn: sleeping in atomic context
fs/inode.c:1724 insert_inode_locked() warn: sleeping in atomic context

Old smatch warnings:
fs/inode.c:1371 iget_locked() warn: sleeping in atomic context

vim +1232 fs/inode.c

375e289ea85166 J. Bruce Fields   2012-04-18  1193  
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1194  /**
80ea09a002bf43 Miklos Szeredi    2018-05-17  1195   * inode_insert5 - obtain an inode from a mounted file system
80ea09a002bf43 Miklos Szeredi    2018-05-17  1196   * @inode:	pre-allocated inode to use for insert to cache
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1197   * @hashval:	hash value (usually inode number) to get
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1198   * @test:	callback used for comparisons between inodes
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1199   * @set:	callback used to initialize a new struct inode
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1200   * @data:	opaque data pointer to pass to @test and @set
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1201   *
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1202   * Search for the inode specified by @hashval and @data in the inode cache,
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1203   * and if present it is return it with an increased reference count. This is
80ea09a002bf43 Miklos Szeredi    2018-05-17  1204   * a variant of iget5_locked() for callers that don't want to fail on memory
80ea09a002bf43 Miklos Szeredi    2018-05-17  1205   * allocation of inode.
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1206   *
80ea09a002bf43 Miklos Szeredi    2018-05-17  1207   * If the inode is not in cache, insert the pre-allocated inode to cache and
80ea09a002bf43 Miklos Szeredi    2018-05-17  1208   * return it locked, hashed, and with the I_NEW flag set. The file system gets
80ea09a002bf43 Miklos Szeredi    2018-05-17  1209   * to fill it in before unlocking it via unlock_new_inode().
^1da177e4c3f41 Linus Torvalds    2005-04-16  1210   *
c41f58169b510c Dave Chinner      2023-05-09  1211   * Note both @test and @set are called with the inode hash chain lock held,
c41f58169b510c Dave Chinner      2023-05-09  1212   * so can't sleep.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213   */
80ea09a002bf43 Miklos Szeredi    2018-05-17  1214  struct inode *inode_insert5(struct inode *inode, unsigned long hashval,
6b3304b5317047 Manish Katiyar    2009-03-31  1215  			    int (*test)(struct inode *, void *),
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1216  			    int (*set)(struct inode *, void *), void *data)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  {
c41f58169b510c Dave Chinner      2023-05-09  1218  	struct hlist_bl_head *b = i_hash_head(inode->i_sb, hashval);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1219  	struct inode *old;
80ea09a002bf43 Miklos Szeredi    2018-05-17  1220  
2864f301424227 Al Viro           2016-07-03  1221  again:
c41f58169b510c Dave Chinner      2023-05-09  1222  	hlist_bl_lock(b);
c41f58169b510c Dave Chinner      2023-05-09  1223  	old = find_inode(inode->i_sb, b, test, data);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1224  	if (unlikely(old)) {
80ea09a002bf43 Miklos Szeredi    2018-05-17  1225  		/*
80ea09a002bf43 Miklos Szeredi    2018-05-17  1226  		 * Uhhuh, somebody else created the same inode under us.
80ea09a002bf43 Miklos Szeredi    2018-05-17  1227  		 * Use the old inode instead of the preallocated one.
80ea09a002bf43 Miklos Szeredi    2018-05-17  1228  		 */
c41f58169b510c Dave Chinner      2023-05-09  1229  		hlist_bl_unlock(b);
c2b6d621c4ffe9 Al Viro           2018-06-28  1230  		if (IS_ERR(old))
c2b6d621c4ffe9 Al Viro           2018-06-28  1231  			return NULL;
80ea09a002bf43 Miklos Szeredi    2018-05-17 @1232  		wait_on_inode(old);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1233  		if (unlikely(inode_unhashed(old))) {
80ea09a002bf43 Miklos Szeredi    2018-05-17  1234  			iput(old);
2864f301424227 Al Viro           2016-07-03  1235  			goto again;
2864f301424227 Al Viro           2016-07-03  1236  		}
80ea09a002bf43 Miklos Szeredi    2018-05-17  1237  		return old;
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1238  	}
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1239  
80ea09a002bf43 Miklos Szeredi    2018-05-17  1240  	if (set && unlikely(set(inode, data))) {
80ea09a002bf43 Miklos Szeredi    2018-05-17  1241  		inode = NULL;
80ea09a002bf43 Miklos Szeredi    2018-05-17  1242  		goto unlock;
80ea09a002bf43 Miklos Szeredi    2018-05-17  1243  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  
80ea09a002bf43 Miklos Szeredi    2018-05-17  1245  	/*
80ea09a002bf43 Miklos Szeredi    2018-05-17  1246  	 * Return the locked inode with I_NEW set, the
80ea09a002bf43 Miklos Szeredi    2018-05-17  1247  	 * caller is responsible for filling in the contents
80ea09a002bf43 Miklos Szeredi    2018-05-17  1248  	 */
250df6ed274d76 Dave Chinner      2011-03-22  1249  	spin_lock(&inode->i_lock);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1250  	inode->i_state |= I_NEW;
c41f58169b510c Dave Chinner      2023-05-09  1251  	__insert_inode_hash_head(inode, b);
250df6ed274d76 Dave Chinner      2011-03-22  1252  	spin_unlock(&inode->i_lock);
18cc912b8a2aca Jeff Layton       2022-03-31  1253  
18cc912b8a2aca Jeff Layton       2022-03-31  1254  	/*
18cc912b8a2aca Jeff Layton       2022-03-31  1255  	 * Add inode to the sb list if it's not already. It has I_NEW at this
18cc912b8a2aca Jeff Layton       2022-03-31  1256  	 * point, so it should be safe to test i_sb_list locklessly.
18cc912b8a2aca Jeff Layton       2022-03-31  1257  	 */
18cc912b8a2aca Jeff Layton       2022-03-31  1258  	if (list_empty(&inode->i_sb_list))
e950564b97fd0f Miklos Szeredi    2018-07-24  1259  		inode_sb_list_add(inode);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1260  unlock:
c41f58169b510c Dave Chinner      2023-05-09  1261  	hlist_bl_unlock(b);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1262  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1263  	return inode;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1264  }
80ea09a002bf43 Miklos Szeredi    2018-05-17  1265  EXPORT_SYMBOL(inode_insert5);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1266  
80ea09a002bf43 Miklos Szeredi    2018-05-17  1267  /**
80ea09a002bf43 Miklos Szeredi    2018-05-17  1268   * iget5_locked - obtain an inode from a mounted file system
80ea09a002bf43 Miklos Szeredi    2018-05-17  1269   * @sb:		super block of file system
80ea09a002bf43 Miklos Szeredi    2018-05-17  1270   * @hashval:	hash value (usually inode number) to get
80ea09a002bf43 Miklos Szeredi    2018-05-17  1271   * @test:	callback used for comparisons between inodes
80ea09a002bf43 Miklos Szeredi    2018-05-17  1272   * @set:	callback used to initialize a new struct inode
80ea09a002bf43 Miklos Szeredi    2018-05-17  1273   * @data:	opaque data pointer to pass to @test and @set
80ea09a002bf43 Miklos Szeredi    2018-05-17  1274   *
80ea09a002bf43 Miklos Szeredi    2018-05-17  1275   * Search for the inode specified by @hashval and @data in the inode cache,
80ea09a002bf43 Miklos Szeredi    2018-05-17  1276   * and if present it is return it with an increased reference count. This is
80ea09a002bf43 Miklos Szeredi    2018-05-17  1277   * a generalized version of iget_locked() for file systems where the inode
80ea09a002bf43 Miklos Szeredi    2018-05-17  1278   * number is not sufficient for unique identification of an inode.
80ea09a002bf43 Miklos Szeredi    2018-05-17  1279   *
80ea09a002bf43 Miklos Szeredi    2018-05-17  1280   * If the inode is not in cache, allocate a new inode and return it locked,
80ea09a002bf43 Miklos Szeredi    2018-05-17  1281   * hashed, and with the I_NEW flag set. The file system gets to fill it in
80ea09a002bf43 Miklos Szeredi    2018-05-17  1282   * before unlocking it via unlock_new_inode().
80ea09a002bf43 Miklos Szeredi    2018-05-17  1283   *
80ea09a002bf43 Miklos Szeredi    2018-05-17  1284   * Note both @test and @set are called with the inode_hash_lock held, so can't
80ea09a002bf43 Miklos Szeredi    2018-05-17  1285   * sleep.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1286   */
80ea09a002bf43 Miklos Szeredi    2018-05-17  1287  struct inode *iget5_locked(struct super_block *sb, unsigned long hashval,
80ea09a002bf43 Miklos Szeredi    2018-05-17  1288  		int (*test)(struct inode *, void *),
80ea09a002bf43 Miklos Szeredi    2018-05-17  1289  		int (*set)(struct inode *, void *), void *data)
80ea09a002bf43 Miklos Szeredi    2018-05-17  1290  {
80ea09a002bf43 Miklos Szeredi    2018-05-17  1291  	struct inode *inode = ilookup5(sb, hashval, test, data);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1292  
80ea09a002bf43 Miklos Szeredi    2018-05-17  1293  	if (!inode) {
e950564b97fd0f Miklos Szeredi    2018-07-24  1294  		struct inode *new = alloc_inode(sb);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1295  
80ea09a002bf43 Miklos Szeredi    2018-05-17  1296  		if (new) {
e950564b97fd0f Miklos Szeredi    2018-07-24  1297  			new->i_state = 0;
80ea09a002bf43 Miklos Szeredi    2018-05-17  1298  			inode = inode_insert5(new, hashval, test, set, data);
80ea09a002bf43 Miklos Szeredi    2018-05-17  1299  			if (unlikely(inode != new))
e950564b97fd0f Miklos Szeredi    2018-07-24  1300  				destroy_inode(new);
2864f301424227 Al Viro           2016-07-03  1301  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1302  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1303  	return inode;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1304  }
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1305  EXPORT_SYMBOL(iget5_locked);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1306  
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1307  /**
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1308   * iget_locked - obtain an inode from a mounted file system
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1309   * @sb:		super block of file system
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1310   * @ino:	inode number to get
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1311   *
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1312   * Search for the inode specified by @ino in the inode cache and if present
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1313   * return it with an increased reference count. This is for file systems
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1314   * where the inode number is sufficient for unique identification of an inode.
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1315   *
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1316   * If the inode is not in cache, allocate a new inode and return it locked,
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1317   * hashed, and with the I_NEW flag set.  The file system gets to fill it in
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1318   * before unlocking it via unlock_new_inode().
^1da177e4c3f41 Linus Torvalds    2005-04-16  1319   */
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1320  struct inode *iget_locked(struct super_block *sb, unsigned long ino)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1321  {
c41f58169b510c Dave Chinner      2023-05-09  1322  	struct hlist_bl_head *b = i_hash_head(sb, ino);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1323  	struct inode *inode;
2864f301424227 Al Viro           2016-07-03  1324  again:
c41f58169b510c Dave Chinner      2023-05-09  1325  	hlist_bl_lock(b);
c41f58169b510c Dave Chinner      2023-05-09  1326  	inode = find_inode_fast(sb, b, ino);
c41f58169b510c Dave Chinner      2023-05-09  1327  	hlist_bl_unlock(b);
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1328  	if (inode) {
c2b6d621c4ffe9 Al Viro           2018-06-28  1329  		if (IS_ERR(inode))
c2b6d621c4ffe9 Al Viro           2018-06-28  1330  			return NULL;
0b2d0724e26a33 Christoph Hellwig 2011-03-23 @1331  		wait_on_inode(inode);
2864f301424227 Al Viro           2016-07-03  1332  		if (unlikely(inode_unhashed(inode))) {
2864f301424227 Al Viro           2016-07-03  1333  			iput(inode);
2864f301424227 Al Viro           2016-07-03  1334  			goto again;
2864f301424227 Al Viro           2016-07-03  1335  		}
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1336  		return inode;
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1337  	}
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1338  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1339  	inode = alloc_inode(sb);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1340  	if (inode) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1341  		struct inode *old;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1342  
c41f58169b510c Dave Chinner      2023-05-09  1343  		hlist_bl_lock(b);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1344  		/* We released the lock, so.. */
c41f58169b510c Dave Chinner      2023-05-09  1345  		old = find_inode_fast(sb, b, ino);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1346  		if (!old) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1347  			inode->i_ino = ino;
250df6ed274d76 Dave Chinner      2011-03-22  1348  			spin_lock(&inode->i_lock);
250df6ed274d76 Dave Chinner      2011-03-22  1349  			inode->i_state = I_NEW;
c41f58169b510c Dave Chinner      2023-05-09  1350  			__insert_inode_hash_head(inode, b);
250df6ed274d76 Dave Chinner      2011-03-22  1351  			spin_unlock(&inode->i_lock);
55fa6091d83160 Dave Chinner      2011-03-22  1352  			inode_sb_list_add(inode);
c41f58169b510c Dave Chinner      2023-05-09  1353  			hlist_bl_unlock(b);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1354  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1355  			/* Return the locked inode with I_NEW set, the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1356  			 * caller is responsible for filling in the contents
^1da177e4c3f41 Linus Torvalds    2005-04-16  1357  			 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1358  			return inode;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1359  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1360  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1361  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1362  		 * Uhhuh, somebody else created the same inode under
^1da177e4c3f41 Linus Torvalds    2005-04-16  1363  		 * us. Use the old inode instead of the one we just
^1da177e4c3f41 Linus Torvalds    2005-04-16  1364  		 * allocated.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1365  		 */
c41f58169b510c Dave Chinner      2023-05-09  1366  		hlist_bl_unlock(b);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1367  		destroy_inode(inode);
c2b6d621c4ffe9 Al Viro           2018-06-28  1368  		if (IS_ERR(old))
c2b6d621c4ffe9 Al Viro           2018-06-28  1369  			return NULL;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1370  		inode = old;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1371  		wait_on_inode(inode);
2864f301424227 Al Viro           2016-07-03  1372  		if (unlikely(inode_unhashed(inode))) {
2864f301424227 Al Viro           2016-07-03  1373  			iput(inode);
2864f301424227 Al Viro           2016-07-03  1374  			goto again;
2864f301424227 Al Viro           2016-07-03  1375  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1376  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1377  	return inode;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1378  }
0b2d0724e26a33 Christoph Hellwig 2011-03-23  1379  EXPORT_SYMBOL(iget_locked);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1380  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 208+ messages in thread

end of thread, other threads:[~2023-11-04 20:51 UTC | newest]

Thread overview: 208+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09 16:56 [PATCH 00/32] bcachefs - a new COW filesystem Kent Overstreet
2023-05-09 16:56 ` [PATCH 01/32] Compiler Attributes: add __flatten Kent Overstreet
2023-05-09 17:04   ` Miguel Ojeda
2023-05-09 17:24     ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 02/32] locking/lockdep: lock_class_is_held() Kent Overstreet
2023-05-09 19:30   ` Peter Zijlstra
2023-05-09 20:11     ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 03/32] locking/lockdep: lockdep_set_no_check_recursion() Kent Overstreet
2023-05-09 19:31   ` Peter Zijlstra
2023-05-09 19:57     ` Kent Overstreet
2023-05-09 20:18     ` Kent Overstreet
2023-05-09 20:27       ` Waiman Long
2023-05-09 20:35         ` Kent Overstreet
2023-05-09 21:37           ` Waiman Long
2023-05-10  8:59       ` Peter Zijlstra
2023-05-10 20:38         ` Kent Overstreet
2023-05-11  8:25           ` Peter Zijlstra
2023-05-11  9:32             ` Kent Overstreet
2023-05-12 20:49         ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 04/32] locking: SIX locks (shared/intent/exclusive) Kent Overstreet
2023-05-11 12:14   ` Jan Engelhardt
2023-05-12 20:58     ` Kent Overstreet
2023-05-12 22:39       ` Jan Engelhardt
2023-05-12 23:26         ` Kent Overstreet
2023-05-12 23:49           ` Randy Dunlap
2023-05-13  0:17             ` Kent Overstreet
2023-05-13  0:45               ` Eric Biggers
2023-05-13  0:51                 ` Kent Overstreet
2023-05-14 12:15   ` Jeff Layton
2023-05-15  2:39     ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 05/32] MAINTAINERS: Add entry for six locks Kent Overstreet
2023-05-09 16:56 ` [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping Kent Overstreet
2023-05-10  1:07   ` Jan Kara
2023-05-10  6:18     ` Kent Overstreet
2023-05-23 13:34       ` [Cluster-devel] " Jan Kara
2023-05-23 13:34         ` Jan Kara
2023-05-23 16:21         ` [Cluster-devel] " Christoph Hellwig
2023-05-23 16:21           ` Christoph Hellwig
2023-05-23 16:35           ` Kent Overstreet
2023-05-23 16:35             ` Kent Overstreet
2023-05-24  6:43             ` Christoph Hellwig
2023-05-24  6:43               ` Christoph Hellwig
2023-05-24  8:09               ` Kent Overstreet
2023-05-24  8:09                 ` Kent Overstreet
2023-05-25  8:58                 ` Christoph Hellwig
2023-05-25  8:58                   ` Christoph Hellwig
2023-05-25 20:50                   ` Kent Overstreet
2023-05-25 20:50                     ` Kent Overstreet
2023-05-26  8:06                     ` Christoph Hellwig
2023-05-26  8:06                       ` Christoph Hellwig
2023-05-26  8:34                       ` Kent Overstreet
2023-05-26  8:34                         ` Kent Overstreet
2023-05-25 21:40                   ` Kent Overstreet
2023-05-25 21:40                     ` Kent Overstreet
2023-05-25 22:25           ` Andreas Grünbacher
2023-05-25 22:25             ` Andreas Grünbacher
2023-05-25 23:20             ` Kent Overstreet
2023-05-25 23:20               ` Kent Overstreet
2023-05-26  0:05               ` Andreas Grünbacher
2023-05-26  0:05                 ` Andreas Grünbacher
2023-05-26  0:39                 ` Kent Overstreet
2023-05-26  0:39                   ` Kent Overstreet
2023-05-26  8:10               ` Christoph Hellwig
2023-05-26  8:10                 ` Christoph Hellwig
2023-05-26  8:38                 ` Kent Overstreet
2023-05-26  8:38                   ` Kent Overstreet
2023-05-23 16:49         ` Kent Overstreet
2023-05-23 16:49           ` Kent Overstreet
2023-05-25  8:47           ` [Cluster-devel] " Jan Kara
2023-05-25  8:47             ` Jan Kara
2023-05-25 21:36             ` [Cluster-devel] " Kent Overstreet
2023-05-25 21:36               ` Kent Overstreet
2023-05-25 22:45             ` [Cluster-devel] " Andreas Grünbacher
2023-05-25 22:45               ` Andreas Grünbacher
2023-05-25 22:04         ` [Cluster-devel] " Andreas Grünbacher
2023-05-25 22:04           ` Andreas Grünbacher
2023-05-09 16:56 ` [PATCH 07/32] mm: Bring back vmalloc_exec Kent Overstreet
2023-05-09 18:19   ` Lorenzo Stoakes
2023-05-09 20:15     ` Kent Overstreet
2023-05-09 20:46   ` Christoph Hellwig
2023-05-09 21:12     ` Lorenzo Stoakes
2023-05-09 21:29       ` Kent Overstreet
2023-05-10  6:48         ` Eric Biggers
2023-05-12 18:36           ` Kent Overstreet
2023-05-13  1:57             ` Eric Biggers
2023-05-13 19:28               ` Kent Overstreet
2023-05-14  5:45               ` Kent Overstreet
2023-05-14 18:43                 ` Eric Biggers
2023-05-15  5:38                   ` Kent Overstreet
2023-05-15  6:13                     ` Eric Biggers
2023-05-15  6:18                       ` Kent Overstreet
2023-05-15  7:13                         ` Eric Biggers
2023-05-15  7:26                           ` Kent Overstreet
2023-05-21 21:33                             ` Eric Biggers
2023-05-21 22:04                               ` Kent Overstreet
2023-05-15 10:29                 ` David Laight
2023-05-10 11:56         ` David Laight
2023-05-09 21:43       ` Darrick J. Wong
2023-05-09 21:54         ` Kent Overstreet
2023-05-11  5:33           ` Theodore Ts'o
2023-05-11  5:44             ` Kent Overstreet
2023-05-13 13:25       ` Lorenzo Stoakes
2023-05-14 18:39         ` Christophe Leroy
2023-05-14 23:43           ` Kent Overstreet
2023-05-15  4:45             ` Christophe Leroy
2023-05-15  5:02               ` Kent Overstreet
2023-05-10 14:18   ` Christophe Leroy
2023-05-10 15:05   ` Johannes Thumshirn
2023-05-11 22:28     ` Kees Cook
2023-05-12 18:41       ` Kent Overstreet
2023-05-16 21:02         ` Kees Cook
2023-05-16 21:20           ` Kent Overstreet
2023-05-16 21:47             ` Matthew Wilcox
2023-05-16 21:57               ` Kent Overstreet
2023-05-17  5:28               ` Kent Overstreet
2023-05-17 14:04                 ` Mike Rapoport
2023-05-17 14:18                   ` Kent Overstreet
2023-05-17 15:44                     ` Mike Rapoport
2023-05-17 15:59                       ` Kent Overstreet
2023-06-17  4:13             ` Andy Lutomirski
2023-06-17 15:34               ` Kent Overstreet
2023-06-17 19:19                 ` Andy Lutomirski
2023-06-17 20:08                   ` Kent Overstreet
2023-06-17 20:35                     ` Andy Lutomirski
2023-06-19 19:45                 ` Kees Cook
2023-06-20  0:39                   ` Kent Overstreet
2023-06-19  9:19   ` Mark Rutland
2023-06-19 10:47     ` Kent Overstreet
2023-06-19 12:47       ` Mark Rutland
2023-06-19 19:17         ` Kent Overstreet
2023-06-20 17:42           ` Andy Lutomirski
2023-06-20 18:08             ` Kent Overstreet
2023-06-20 18:15               ` Andy Lutomirski
2023-06-20 18:48                 ` Dave Hansen
2023-06-20 20:18                   ` Kent Overstreet
2023-06-20 20:42                   ` Andy Lutomirski
2023-06-20 22:32                     ` Andy Lutomirski
2023-06-20 22:43                       ` Nadav Amit
2023-06-21  1:27                         ` Andy Lutomirski
2023-05-09 16:56 ` [PATCH 08/32] fs: factor out d_mark_tmpfile() Kent Overstreet
2023-05-09 16:56 ` [PATCH 09/32] block: Add some exports for bcachefs Kent Overstreet
2023-05-09 16:56 ` [PATCH 10/32] block: Allow bio_iov_iter_get_pages() with bio->bi_bdev unset Kent Overstreet
2023-05-09 16:56 ` [PATCH 11/32] block: Bring back zero_fill_bio_iter Kent Overstreet
2023-05-09 16:56 ` [PATCH 12/32] block: Rework bio_for_each_segment_all() Kent Overstreet
2023-05-09 16:56 ` [PATCH 13/32] block: Rework bio_for_each_folio_all() Kent Overstreet
2023-05-09 16:56 ` [PATCH 14/32] block: Don't block on s_umount from __invalidate_super() Kent Overstreet
2023-05-09 16:56 ` [PATCH 15/32] bcache: move closures to lib/ Kent Overstreet
2023-05-10  1:10   ` Randy Dunlap
2023-05-09 16:56 ` [PATCH 16/32] MAINTAINERS: Add entry for closures Kent Overstreet
2023-05-09 17:05   ` Coly Li
2023-05-09 21:03   ` Randy Dunlap
2023-05-09 16:56 ` [PATCH 17/32] closures: closure_wait_event() Kent Overstreet
2023-05-09 16:56 ` [PATCH 18/32] closures: closure_nr_remaining() Kent Overstreet
2023-05-09 16:56 ` [PATCH 19/32] closures: Add a missing include Kent Overstreet
2023-05-09 16:56 ` [PATCH 20/32] vfs: factor out inode hash head calculation Kent Overstreet
2023-05-23  9:27   ` (subset) " Christian Brauner
2023-05-23 22:53     ` Dave Chinner
2023-05-24  6:44       ` Christoph Hellwig
2023-05-24  7:35         ` Dave Chinner
2023-05-24  8:31           ` Christian Brauner
2023-05-24  8:41             ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 21/32] hlist-bl: add hlist_bl_fake() Kent Overstreet
2023-05-10  4:48   ` Dave Chinner
2023-05-23  9:27   ` (subset) " Christian Brauner
2023-05-09 16:56 ` [PATCH 22/32] vfs: inode cache conversion to hash-bl Kent Overstreet
2023-05-10  4:45   ` Dave Chinner
2023-05-16 15:45     ` Christian Brauner
2023-05-16 16:17       ` Kent Overstreet
2023-05-16 23:15         ` Dave Chinner
2023-05-22 13:04           ` Christian Brauner
2023-05-23  9:28   ` (subset) " Christian Brauner
2023-10-19 15:30     ` Mateusz Guzik
2023-10-19 15:59       ` Mateusz Guzik
2023-10-20 11:38         ` Dave Chinner
2023-10-20 17:49           ` Mateusz Guzik
2023-10-21 12:13             ` Mateusz Guzik
2023-10-23  5:10             ` Dave Chinner
2023-10-27 17:13               ` Mateusz Guzik
2023-10-27 18:36                 ` Darrick J. Wong
2023-10-31 11:02                 ` Christian Brauner
2023-10-31 11:31                   ` Mateusz Guzik
2023-11-02  2:36                   ` Kent Overstreet
2023-11-04 20:51                     ` Dave Chinner
2023-05-09 16:56 ` [PATCH 23/32] iov_iter: copy_folio_from_iter_atomic() Kent Overstreet
2023-05-10  2:20   ` kernel test robot
2023-05-11  2:08   ` kernel test robot
2023-05-09 16:56 ` [PATCH 24/32] MAINTAINERS: Add entry for generic-radix-tree Kent Overstreet
2023-05-09 21:03   ` Randy Dunlap
2023-05-09 16:56 ` [PATCH 25/32] lib/generic-radix-tree.c: Don't overflow in peek() Kent Overstreet
2023-05-09 16:56 ` [PATCH 26/32] lib/generic-radix-tree.c: Add a missing include Kent Overstreet
2023-05-09 16:56 ` [PATCH 27/32] lib/generic-radix-tree.c: Add peek_prev() Kent Overstreet
2023-05-09 16:56 ` [PATCH 28/32] stacktrace: Export stack_trace_save_tsk Kent Overstreet
2023-06-19  9:10   ` Mark Rutland
2023-06-19 11:16     ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 29/32] lib/string_helpers: string_get_size() now returns characters wrote Kent Overstreet
2023-07-12 19:58   ` Kees Cook
2023-07-12 20:19     ` Kent Overstreet
2023-07-12 22:38       ` Kees Cook
2023-07-12 23:53         ` Kent Overstreet
2023-07-12 20:23     ` Kent Overstreet
2023-05-09 16:56 ` [PATCH 30/32] lib: Export errname Kent Overstreet
2023-05-09 16:56 ` [PATCH 31/32] lib: add mean and variance module Kent Overstreet
2023-05-09 16:56 ` [PATCH 32/32] MAINTAINERS: Add entry for bcachefs Kent Overstreet
2023-05-09 21:04   ` Randy Dunlap
2023-05-09 21:07     ` Kent Overstreet
2023-06-15 20:41 ` [PATCH 00/32] bcachefs - a new COW filesystem Pavel Machek
2023-06-15 21:26   ` Kent Overstreet
  -- strict thread matches above, loose matches on Subject: below --
2023-05-10 19:55 [PATCH 22/32] vfs: inode cache conversion to hash-bl kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.