Re: [PATCH v5 8/9] iov_iter, block: Make bio structs pin pages rather than ref'ing if appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 12, 2023 at 10:28:41AM +0000, David Howells wrote:
> Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> 
> > 	if (cleanup_mode & FOLL_GET) {
> > 		WARN_ON_ONCE(bio_test_flag(bio, BIO_PAGE_PINNED));
> > 		bio_set_flag(bio, BIO_PAGE_REFFED);
> > 	}
> > 	if (cleanup_mode & FOLL_PIN) {
> > 		WARN_ON_ONCE(bio_test_flag(bio, BIO_PAGE_REFFED));
> > 		bio_set_flag(bio, BIO_PAGE_PINNED);
> > 	}
> 
> That won't necessarily work as you might get back cleanup_mode == 0, in which
> case both flags are cleared - and neither warning will trip on the next
> addition.

Well, it will work for the intended use case even with
cleanup_mode == 0, we just won't get the debug check.  Or am I missing
something fundamental?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux