lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202103051151.Ab56fnLC-lkp@intel.com>
Date:   Fri, 5 Mar 2021 12:04:36 +0800
From:   kernel test robot <lkp@...el.com>
To:     Konstantin Komarov <almaz.alexandrovich@...agon-software.com>,
        linux-fsdevel@...r.kernel.org
Cc:     kbuild-all@...org, viro@...iv.linux.org.uk,
        linux-kernel@...r.kernel.org, pali@...nel.org, dsterba@...e.cz,
        aaptel@...e.com, willy@...radead.org, rdunlap@...radead.org,
        joe@...ches.com, mark@...mstone.com
Subject: Re: [PATCH v22 09/10] fs/ntfs3: Add NTFS3 in fs/Kconfig and
 fs/Makefile

Hi Konstantin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8]

url:    https://github.com/0day-ci/linux/commits/Konstantin-Komarov/NTFS-read-write-driver-GPL-implementation-by-Paragon-Software/20210302-000938
base:   fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8
config: openrisc-randconfig-r031-20210305 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/94dd419cbcd18faff52a6d852f2571684175a98f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Konstantin-Komarov/NTFS-read-write-driver-GPL-implementation-by-Paragon-Software/20210302-000938
        git checkout 94dd419cbcd18faff52a6d852f2571684175a98f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   fs/ntfs3/attrib.c: In function 'attr_data_get_block':
>> fs/ntfs3/attrib.c:834:6: warning: variable 'new_size' set but not used [-Wunused-but-set-variable]
     834 |  u64 new_size, total_size;
         |      ^~~~~~~~
--
>> fs/ntfs3/index.c:554:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
     554 | static const inline struct NTFS_DE *hdr_find_split(const struct INDEX_HDR *hdr)
         | ^~~~~~
   fs/ntfs3/index.c:585:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
     585 | static const inline struct NTFS_DE *
         | ^~~~~~
   fs/ntfs3/index.c: In function 'indx_add_allocate':
>> fs/ntfs3/index.c:1465:17: warning: variable 'alloc_size' set but not used [-Wunused-but-set-variable]
    1465 |  u64 data_size, alloc_size;
         |                 ^~~~~~~~~~
   fs/ntfs3/index.c: In function 'indx_insert_into_root':
>> fs/ntfs3/index.c:1555:8: warning: variable 'next' set but not used [-Wunused-but-set-variable]
    1555 |  char *next;
         |        ^~~~
>> fs/ntfs3/index.c:1552:40: warning: variable 'aoff' set but not used [-Wunused-but-set-variable]
    1552 |  u32 hdr_used, hdr_total, asize, used, aoff, to_move;
         |                                        ^~~~
--
   fs/ntfs3/run.c: In function 'run_packed_size':
>> fs/ntfs3/run.c:603:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     603 |  return (const u8 *)n + sizeof(n) - p;
         |         ^


vim +/new_size +834 fs/ntfs3/attrib.c

10063fbe42995c Konstantin Komarov 2021-03-01   822  
10063fbe42995c Konstantin Komarov 2021-03-01   823  int attr_data_get_block(struct ntfs_inode *ni, CLST vcn, CLST clen, CLST *lcn,
10063fbe42995c Konstantin Komarov 2021-03-01   824  			CLST *len, bool *new)
10063fbe42995c Konstantin Komarov 2021-03-01   825  {
10063fbe42995c Konstantin Komarov 2021-03-01   826  	int err = 0;
10063fbe42995c Konstantin Komarov 2021-03-01   827  	struct runs_tree *run = &ni->file.run;
10063fbe42995c Konstantin Komarov 2021-03-01   828  	struct ntfs_sb_info *sbi;
10063fbe42995c Konstantin Komarov 2021-03-01   829  	u8 cluster_bits;
10063fbe42995c Konstantin Komarov 2021-03-01   830  	struct ATTRIB *attr = NULL, *attr_b;
10063fbe42995c Konstantin Komarov 2021-03-01   831  	struct ATTR_LIST_ENTRY *le, *le_b;
10063fbe42995c Konstantin Komarov 2021-03-01   832  	struct mft_inode *mi, *mi_b;
10063fbe42995c Konstantin Komarov 2021-03-01   833  	CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end;
10063fbe42995c Konstantin Komarov 2021-03-01  @834  	u64 new_size, total_size;
10063fbe42995c Konstantin Komarov 2021-03-01   835  	u32 clst_per_frame;
10063fbe42995c Konstantin Komarov 2021-03-01   836  	bool ok;
10063fbe42995c Konstantin Komarov 2021-03-01   837  
10063fbe42995c Konstantin Komarov 2021-03-01   838  	if (new)
10063fbe42995c Konstantin Komarov 2021-03-01   839  		*new = false;
10063fbe42995c Konstantin Komarov 2021-03-01   840  
10063fbe42995c Konstantin Komarov 2021-03-01   841  	down_read(&ni->file.run_lock);
10063fbe42995c Konstantin Komarov 2021-03-01   842  	ok = run_lookup_entry(run, vcn, lcn, len, NULL);
10063fbe42995c Konstantin Komarov 2021-03-01   843  	up_read(&ni->file.run_lock);
10063fbe42995c Konstantin Komarov 2021-03-01   844  
10063fbe42995c Konstantin Komarov 2021-03-01   845  	if (ok && (*lcn != SPARSE_LCN || !new)) {
10063fbe42995c Konstantin Komarov 2021-03-01   846  		/* normal way */
10063fbe42995c Konstantin Komarov 2021-03-01   847  		return 0;
10063fbe42995c Konstantin Komarov 2021-03-01   848  	}
10063fbe42995c Konstantin Komarov 2021-03-01   849  
10063fbe42995c Konstantin Komarov 2021-03-01   850  	if (!clen)
10063fbe42995c Konstantin Komarov 2021-03-01   851  		clen = 1;
10063fbe42995c Konstantin Komarov 2021-03-01   852  
10063fbe42995c Konstantin Komarov 2021-03-01   853  	if (ok && clen > *len)
10063fbe42995c Konstantin Komarov 2021-03-01   854  		clen = *len;
10063fbe42995c Konstantin Komarov 2021-03-01   855  
10063fbe42995c Konstantin Komarov 2021-03-01   856  	sbi = ni->mi.sbi;
10063fbe42995c Konstantin Komarov 2021-03-01   857  	cluster_bits = sbi->cluster_bits;
10063fbe42995c Konstantin Komarov 2021-03-01   858  	new_size = ((u64)vcn + clen) << cluster_bits;
10063fbe42995c Konstantin Komarov 2021-03-01   859  
10063fbe42995c Konstantin Komarov 2021-03-01   860  	ni_lock(ni);
10063fbe42995c Konstantin Komarov 2021-03-01   861  	down_write(&ni->file.run_lock);
10063fbe42995c Konstantin Komarov 2021-03-01   862  
10063fbe42995c Konstantin Komarov 2021-03-01   863  	le_b = NULL;
10063fbe42995c Konstantin Komarov 2021-03-01   864  	attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL, &mi_b);
10063fbe42995c Konstantin Komarov 2021-03-01   865  	if (!attr_b) {
10063fbe42995c Konstantin Komarov 2021-03-01   866  		err = -ENOENT;
10063fbe42995c Konstantin Komarov 2021-03-01   867  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   868  	}
10063fbe42995c Konstantin Komarov 2021-03-01   869  
10063fbe42995c Konstantin Komarov 2021-03-01   870  	if (!attr_b->non_res) {
10063fbe42995c Konstantin Komarov 2021-03-01   871  		*lcn = RESIDENT_LCN;
10063fbe42995c Konstantin Komarov 2021-03-01   872  		*len = 1;
10063fbe42995c Konstantin Komarov 2021-03-01   873  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   874  	}
10063fbe42995c Konstantin Komarov 2021-03-01   875  
10063fbe42995c Konstantin Komarov 2021-03-01   876  	asize = le64_to_cpu(attr_b->nres.alloc_size) >> sbi->cluster_bits;
10063fbe42995c Konstantin Komarov 2021-03-01   877  	if (vcn >= asize) {
10063fbe42995c Konstantin Komarov 2021-03-01   878  		err = -EINVAL;
10063fbe42995c Konstantin Komarov 2021-03-01   879  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   880  	}
10063fbe42995c Konstantin Komarov 2021-03-01   881  
10063fbe42995c Konstantin Komarov 2021-03-01   882  	clst_per_frame = 1u << attr_b->nres.c_unit;
10063fbe42995c Konstantin Komarov 2021-03-01   883  	to_alloc = (clen + clst_per_frame - 1) & ~(clst_per_frame - 1);
10063fbe42995c Konstantin Komarov 2021-03-01   884  
10063fbe42995c Konstantin Komarov 2021-03-01   885  	if (vcn + to_alloc > asize)
10063fbe42995c Konstantin Komarov 2021-03-01   886  		to_alloc = asize - vcn;
10063fbe42995c Konstantin Komarov 2021-03-01   887  
10063fbe42995c Konstantin Komarov 2021-03-01   888  	svcn = le64_to_cpu(attr_b->nres.svcn);
10063fbe42995c Konstantin Komarov 2021-03-01   889  	evcn1 = le64_to_cpu(attr_b->nres.evcn) + 1;
10063fbe42995c Konstantin Komarov 2021-03-01   890  
10063fbe42995c Konstantin Komarov 2021-03-01   891  	attr = attr_b;
10063fbe42995c Konstantin Komarov 2021-03-01   892  	le = le_b;
10063fbe42995c Konstantin Komarov 2021-03-01   893  	mi = mi_b;
10063fbe42995c Konstantin Komarov 2021-03-01   894  
10063fbe42995c Konstantin Komarov 2021-03-01   895  	if (le_b && (vcn < svcn || evcn1 <= vcn)) {
10063fbe42995c Konstantin Komarov 2021-03-01   896  		attr = ni_find_attr(ni, attr_b, &le, ATTR_DATA, NULL, 0, &vcn,
10063fbe42995c Konstantin Komarov 2021-03-01   897  				    &mi);
10063fbe42995c Konstantin Komarov 2021-03-01   898  		if (!attr) {
10063fbe42995c Konstantin Komarov 2021-03-01   899  			err = -EINVAL;
10063fbe42995c Konstantin Komarov 2021-03-01   900  			goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   901  		}
10063fbe42995c Konstantin Komarov 2021-03-01   902  		svcn = le64_to_cpu(attr->nres.svcn);
10063fbe42995c Konstantin Komarov 2021-03-01   903  		evcn1 = le64_to_cpu(attr->nres.evcn) + 1;
10063fbe42995c Konstantin Komarov 2021-03-01   904  	}
10063fbe42995c Konstantin Komarov 2021-03-01   905  
10063fbe42995c Konstantin Komarov 2021-03-01   906  	err = attr_load_runs(attr, ni, run, NULL);
10063fbe42995c Konstantin Komarov 2021-03-01   907  	if (err)
10063fbe42995c Konstantin Komarov 2021-03-01   908  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   909  
10063fbe42995c Konstantin Komarov 2021-03-01   910  	if (!ok) {
10063fbe42995c Konstantin Komarov 2021-03-01   911  		ok = run_lookup_entry(run, vcn, lcn, len, NULL);
10063fbe42995c Konstantin Komarov 2021-03-01   912  		if (ok && (*lcn != SPARSE_LCN || !new)) {
10063fbe42995c Konstantin Komarov 2021-03-01   913  			/* normal way */
10063fbe42995c Konstantin Komarov 2021-03-01   914  			err = 0;
10063fbe42995c Konstantin Komarov 2021-03-01   915  			goto ok;
10063fbe42995c Konstantin Komarov 2021-03-01   916  		}
10063fbe42995c Konstantin Komarov 2021-03-01   917  
10063fbe42995c Konstantin Komarov 2021-03-01   918  		if (!ok && !new) {
10063fbe42995c Konstantin Komarov 2021-03-01   919  			*len = 0;
10063fbe42995c Konstantin Komarov 2021-03-01   920  			err = 0;
10063fbe42995c Konstantin Komarov 2021-03-01   921  			goto ok;
10063fbe42995c Konstantin Komarov 2021-03-01   922  		}
10063fbe42995c Konstantin Komarov 2021-03-01   923  
10063fbe42995c Konstantin Komarov 2021-03-01   924  		if (ok && clen > *len) {
10063fbe42995c Konstantin Komarov 2021-03-01   925  			clen = *len;
10063fbe42995c Konstantin Komarov 2021-03-01   926  			new_size = ((u64)vcn + clen) << cluster_bits;
10063fbe42995c Konstantin Komarov 2021-03-01   927  			to_alloc = (clen + clst_per_frame - 1) &
10063fbe42995c Konstantin Komarov 2021-03-01   928  				   ~(clst_per_frame - 1);
10063fbe42995c Konstantin Komarov 2021-03-01   929  		}
10063fbe42995c Konstantin Komarov 2021-03-01   930  	}
10063fbe42995c Konstantin Komarov 2021-03-01   931  
10063fbe42995c Konstantin Komarov 2021-03-01   932  	if (!is_attr_ext(attr_b)) {
10063fbe42995c Konstantin Komarov 2021-03-01   933  		err = -EINVAL;
10063fbe42995c Konstantin Komarov 2021-03-01   934  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   935  	}
10063fbe42995c Konstantin Komarov 2021-03-01   936  
10063fbe42995c Konstantin Komarov 2021-03-01   937  	/* Get the last lcn to allocate from */
10063fbe42995c Konstantin Komarov 2021-03-01   938  	hint = 0;
10063fbe42995c Konstantin Komarov 2021-03-01   939  
10063fbe42995c Konstantin Komarov 2021-03-01   940  	if (vcn > evcn1) {
10063fbe42995c Konstantin Komarov 2021-03-01   941  		if (!run_add_entry(run, evcn1, SPARSE_LCN, vcn - evcn1,
10063fbe42995c Konstantin Komarov 2021-03-01   942  				   false)) {
10063fbe42995c Konstantin Komarov 2021-03-01   943  			err = -ENOMEM;
10063fbe42995c Konstantin Komarov 2021-03-01   944  			goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   945  		}
10063fbe42995c Konstantin Komarov 2021-03-01   946  	} else if (vcn && !run_lookup_entry(run, vcn - 1, &hint, NULL, NULL)) {
10063fbe42995c Konstantin Komarov 2021-03-01   947  		hint = -1;
10063fbe42995c Konstantin Komarov 2021-03-01   948  	}
10063fbe42995c Konstantin Komarov 2021-03-01   949  
10063fbe42995c Konstantin Komarov 2021-03-01   950  	err = attr_allocate_clusters(
10063fbe42995c Konstantin Komarov 2021-03-01   951  		sbi, run, vcn, hint + 1, to_alloc, NULL, 0, len,
10063fbe42995c Konstantin Komarov 2021-03-01   952  		(sbi->record_size - le32_to_cpu(mi->mrec->used) + 8) / 3 + 1,
10063fbe42995c Konstantin Komarov 2021-03-01   953  		lcn);
10063fbe42995c Konstantin Komarov 2021-03-01   954  	if (err)
10063fbe42995c Konstantin Komarov 2021-03-01   955  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   956  	*new = true;
10063fbe42995c Konstantin Komarov 2021-03-01   957  
10063fbe42995c Konstantin Komarov 2021-03-01   958  	end = vcn + *len;
10063fbe42995c Konstantin Komarov 2021-03-01   959  
10063fbe42995c Konstantin Komarov 2021-03-01   960  	total_size = le64_to_cpu(attr_b->nres.total_size) +
10063fbe42995c Konstantin Komarov 2021-03-01   961  		     ((u64)*len << cluster_bits);
10063fbe42995c Konstantin Komarov 2021-03-01   962  
10063fbe42995c Konstantin Komarov 2021-03-01   963  repack:
10063fbe42995c Konstantin Komarov 2021-03-01   964  	err = mi_pack_runs(mi, attr, run, max(end, evcn1) - svcn);
10063fbe42995c Konstantin Komarov 2021-03-01   965  	if (err)
10063fbe42995c Konstantin Komarov 2021-03-01   966  		goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   967  
10063fbe42995c Konstantin Komarov 2021-03-01   968  	attr_b->nres.total_size = cpu_to_le64(total_size);
10063fbe42995c Konstantin Komarov 2021-03-01   969  	inode_set_bytes(&ni->vfs_inode, total_size);
10063fbe42995c Konstantin Komarov 2021-03-01   970  	ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
10063fbe42995c Konstantin Komarov 2021-03-01   971  
10063fbe42995c Konstantin Komarov 2021-03-01   972  	mi_b->dirty = true;
10063fbe42995c Konstantin Komarov 2021-03-01   973  	mark_inode_dirty(&ni->vfs_inode);
10063fbe42995c Konstantin Komarov 2021-03-01   974  
10063fbe42995c Konstantin Komarov 2021-03-01   975  	/* stored [vcn : next_svcn) from [vcn : end) */
10063fbe42995c Konstantin Komarov 2021-03-01   976  	next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
10063fbe42995c Konstantin Komarov 2021-03-01   977  
10063fbe42995c Konstantin Komarov 2021-03-01   978  	if (end <= evcn1) {
10063fbe42995c Konstantin Komarov 2021-03-01   979  		if (next_svcn == evcn1) {
10063fbe42995c Konstantin Komarov 2021-03-01   980  			/* Normal way. update attribute and exit */
10063fbe42995c Konstantin Komarov 2021-03-01   981  			goto ok;
10063fbe42995c Konstantin Komarov 2021-03-01   982  		}
10063fbe42995c Konstantin Komarov 2021-03-01   983  		/* add new segment [next_svcn : evcn1 - next_svcn )*/
10063fbe42995c Konstantin Komarov 2021-03-01   984  		if (!ni->attr_list.size) {
10063fbe42995c Konstantin Komarov 2021-03-01   985  			err = ni_create_attr_list(ni);
10063fbe42995c Konstantin Komarov 2021-03-01   986  			if (err)
10063fbe42995c Konstantin Komarov 2021-03-01   987  				goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   988  			/* layout of records is changed */
10063fbe42995c Konstantin Komarov 2021-03-01   989  			le_b = NULL;
10063fbe42995c Konstantin Komarov 2021-03-01   990  			attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL,
10063fbe42995c Konstantin Komarov 2021-03-01   991  					      0, NULL, &mi_b);
10063fbe42995c Konstantin Komarov 2021-03-01   992  			if (!attr_b) {
10063fbe42995c Konstantin Komarov 2021-03-01   993  				err = -ENOENT;
10063fbe42995c Konstantin Komarov 2021-03-01   994  				goto out;
10063fbe42995c Konstantin Komarov 2021-03-01   995  			}
10063fbe42995c Konstantin Komarov 2021-03-01   996  
10063fbe42995c Konstantin Komarov 2021-03-01   997  			attr = attr_b;
10063fbe42995c Konstantin Komarov 2021-03-01   998  			le = le_b;
10063fbe42995c Konstantin Komarov 2021-03-01   999  			mi = mi_b;
10063fbe42995c Konstantin Komarov 2021-03-01  1000  			goto repack;
10063fbe42995c Konstantin Komarov 2021-03-01  1001  		}
10063fbe42995c Konstantin Komarov 2021-03-01  1002  	}
10063fbe42995c Konstantin Komarov 2021-03-01  1003  
10063fbe42995c Konstantin Komarov 2021-03-01  1004  	svcn = evcn1;
10063fbe42995c Konstantin Komarov 2021-03-01  1005  
10063fbe42995c Konstantin Komarov 2021-03-01  1006  	/* Estimate next attribute */
10063fbe42995c Konstantin Komarov 2021-03-01  1007  	attr = ni_find_attr(ni, attr, &le, ATTR_DATA, NULL, 0, &svcn, &mi);
10063fbe42995c Konstantin Komarov 2021-03-01  1008  
10063fbe42995c Konstantin Komarov 2021-03-01  1009  	if (attr) {
10063fbe42995c Konstantin Komarov 2021-03-01  1010  		CLST alloc = bytes_to_cluster(
10063fbe42995c Konstantin Komarov 2021-03-01  1011  			sbi, le64_to_cpu(attr_b->nres.alloc_size));
10063fbe42995c Konstantin Komarov 2021-03-01  1012  		CLST evcn = le64_to_cpu(attr->nres.evcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1013  
10063fbe42995c Konstantin Komarov 2021-03-01  1014  		if (end < next_svcn)
10063fbe42995c Konstantin Komarov 2021-03-01  1015  			end = next_svcn;
10063fbe42995c Konstantin Komarov 2021-03-01  1016  		while (end > evcn) {
10063fbe42995c Konstantin Komarov 2021-03-01  1017  			/* remove segment [svcn : evcn)*/
10063fbe42995c Konstantin Komarov 2021-03-01  1018  			mi_remove_attr(mi, attr);
10063fbe42995c Konstantin Komarov 2021-03-01  1019  
10063fbe42995c Konstantin Komarov 2021-03-01  1020  			if (!al_remove_le(ni, le)) {
10063fbe42995c Konstantin Komarov 2021-03-01  1021  				err = -EINVAL;
10063fbe42995c Konstantin Komarov 2021-03-01  1022  				goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1023  			}
10063fbe42995c Konstantin Komarov 2021-03-01  1024  
10063fbe42995c Konstantin Komarov 2021-03-01  1025  			if (evcn + 1 >= alloc) {
10063fbe42995c Konstantin Komarov 2021-03-01  1026  				/* last attribute segment */
10063fbe42995c Konstantin Komarov 2021-03-01  1027  				evcn1 = evcn + 1;
10063fbe42995c Konstantin Komarov 2021-03-01  1028  				goto ins_ext;
10063fbe42995c Konstantin Komarov 2021-03-01  1029  			}
10063fbe42995c Konstantin Komarov 2021-03-01  1030  
10063fbe42995c Konstantin Komarov 2021-03-01  1031  			if (ni_load_mi(ni, le, &mi)) {
10063fbe42995c Konstantin Komarov 2021-03-01  1032  				attr = NULL;
10063fbe42995c Konstantin Komarov 2021-03-01  1033  				goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1034  			}
10063fbe42995c Konstantin Komarov 2021-03-01  1035  
10063fbe42995c Konstantin Komarov 2021-03-01  1036  			attr = mi_find_attr(mi, NULL, ATTR_DATA, NULL, 0,
10063fbe42995c Konstantin Komarov 2021-03-01  1037  					    &le->id);
10063fbe42995c Konstantin Komarov 2021-03-01  1038  			if (!attr) {
10063fbe42995c Konstantin Komarov 2021-03-01  1039  				err = -EINVAL;
10063fbe42995c Konstantin Komarov 2021-03-01  1040  				goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1041  			}
10063fbe42995c Konstantin Komarov 2021-03-01  1042  			svcn = le64_to_cpu(attr->nres.svcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1043  			evcn = le64_to_cpu(attr->nres.evcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1044  		}
10063fbe42995c Konstantin Komarov 2021-03-01  1045  
10063fbe42995c Konstantin Komarov 2021-03-01  1046  		if (end < svcn)
10063fbe42995c Konstantin Komarov 2021-03-01  1047  			end = svcn;
10063fbe42995c Konstantin Komarov 2021-03-01  1048  
10063fbe42995c Konstantin Komarov 2021-03-01  1049  		err = attr_load_runs(attr, ni, run, &end);
10063fbe42995c Konstantin Komarov 2021-03-01  1050  		if (err)
10063fbe42995c Konstantin Komarov 2021-03-01  1051  			goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1052  
10063fbe42995c Konstantin Komarov 2021-03-01  1053  		evcn1 = evcn + 1;
10063fbe42995c Konstantin Komarov 2021-03-01  1054  		attr->nres.svcn = cpu_to_le64(next_svcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1055  		err = mi_pack_runs(mi, attr, run, evcn1 - next_svcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1056  		if (err)
10063fbe42995c Konstantin Komarov 2021-03-01  1057  			goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1058  
10063fbe42995c Konstantin Komarov 2021-03-01  1059  		le->vcn = cpu_to_le64(next_svcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1060  		ni->attr_list.dirty = true;
10063fbe42995c Konstantin Komarov 2021-03-01  1061  		mi->dirty = true;
10063fbe42995c Konstantin Komarov 2021-03-01  1062  
10063fbe42995c Konstantin Komarov 2021-03-01  1063  		next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
10063fbe42995c Konstantin Komarov 2021-03-01  1064  	}
10063fbe42995c Konstantin Komarov 2021-03-01  1065  ins_ext:
10063fbe42995c Konstantin Komarov 2021-03-01  1066  	if (evcn1 > next_svcn) {
10063fbe42995c Konstantin Komarov 2021-03-01  1067  		err = ni_insert_nonresident(ni, ATTR_DATA, NULL, 0, run,
10063fbe42995c Konstantin Komarov 2021-03-01  1068  					    next_svcn, evcn1 - next_svcn,
10063fbe42995c Konstantin Komarov 2021-03-01  1069  					    attr_b->flags, &attr, &mi);
10063fbe42995c Konstantin Komarov 2021-03-01  1070  		if (err)
10063fbe42995c Konstantin Komarov 2021-03-01  1071  			goto out;
10063fbe42995c Konstantin Komarov 2021-03-01  1072  	}
10063fbe42995c Konstantin Komarov 2021-03-01  1073  ok:
10063fbe42995c Konstantin Komarov 2021-03-01  1074  	run_truncate_around(run, vcn);
10063fbe42995c Konstantin Komarov 2021-03-01  1075  out:
10063fbe42995c Konstantin Komarov 2021-03-01  1076  	up_write(&ni->file.run_lock);
10063fbe42995c Konstantin Komarov 2021-03-01  1077  	ni_unlock(ni);
10063fbe42995c Konstantin Komarov 2021-03-01  1078  
10063fbe42995c Konstantin Komarov 2021-03-01  1079  	return err;
10063fbe42995c Konstantin Komarov 2021-03-01  1080  }
10063fbe42995c Konstantin Komarov 2021-03-01  1081  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (33362 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ