glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

index: simplify index_dir_create()

Open dmantipov opened this issue 1 year ago • 3 comments

Use gf_path_strip_trailing_slashes() and avoid substring copying in index_dir_create(). This tweak also fixes the following warning from gcc-12:

index.c: In function 'index_dir_create':
index.c:282:9: warning: 'strncpy' output truncated before terminating nul
copying as many bytes from a string as its length [-Wstringop-truncation]
  282 |         strncpy(path, fullpath, len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
index.c:272:15: note: length computed here
  272 |     pathlen = strlen(fullpath);
      |               ^~~~~~~~~~~~~~~~

Signed-off-by: Dmitry Antipov [email protected] Updates: #1000

dmantipov avatar Aug 02 '22 14:08 dmantipov

/run regression

dmantipov avatar Aug 02 '22 14:08 dmantipov

/run regression

dmantipov avatar Aug 10 '22 12:08 dmantipov

1 test(s) failed ./tests/bugs/replicate/bug-1586020-mark-dirty-for-entry-txn-on-quorum-failure.t

0 test(s) generated core

6 test(s) needed retry ./tests/000-flaky/basic_mount-nfs-auth.t ./tests/000-flaky/bugs_nfs_bug-1116503.t ./tests/basic/ctime/ctime-rep-rebalance.t ./tests/basic/glusterd/thin-arbiter-volume-probe.t ./tests/bugs/posix/bug-1651445.t ./tests/bugs/replicate/bug-1586020-mark-dirty-for-entry-txn-on-quorum-failure.t

2 flaky test(s) marked as success even though they failed ./tests/000-flaky/basic_mount-nfs-auth.t ./tests/000-flaky/bugs_nfs_bug-1116503.t https://build.gluster.org/job/gh_centos7-regression/2692/

gluster-ant avatar Aug 10 '22 16:08 gluster-ant

/run regression

dmantipov avatar Aug 11 '22 09:08 dmantipov

Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.

stale[bot] avatar Mar 18 '23 17:03 stale[bot]

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.

stale[bot] avatar Apr 02 '23 17:04 stale[bot]