Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write: try to fetch GLUSTERFS_WRITE_IS_APPEND once, not twice in writ… #4362

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

mykaul
Copy link
Contributor

@mykaul mykaul commented May 24, 2024

…e path

We fetch it once (in posix_writev() or posix_writev_fill_rsp_dict() in io_uring code) and then again in _fill_writev_xdata().

Updates: #1000
Signed-off-by: Yaniv Kaul [email protected]

@gluster-ant
Copy link
Collaborator

CLANG-FORMAT FAILURE:
Before merging the patch, this diff needs to be considered for passing clang-format

index fda0c673c..7e474c194 100644
--- a/xlators/storage/posix/src/posix-handle.h
+++ b/xlators/storage/posix/src/posix-handle.h
@@ -222,5 +222,6 @@ void
 posix_disk_space_check(struct posix_private *priv);
 
 dict_t *
-_fill_writev_xdata(inode_t *inode, dict_t *xdata, xlator_t *this, int is_append, gf_boolean_t skip_fetch_write_is_append);
+_fill_writev_xdata(inode_t *inode, dict_t *xdata, xlator_t *this, int is_append,
+                   gf_boolean_t skip_fetch_write_is_append);
 #endif /* !_POSIX_HANDLE_H */
diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c
index eae8f1e14..7d747266d 100644
--- a/xlators/storage/posix/src/posix-inode-fd-ops.c
+++ b/xlators/storage/posix/src/posix-inode-fd-ops.c
@@ -2133,7 +2133,8 @@ overwrite:
         goto out;
     }
 
-    rsp_xdata = _fill_writev_xdata(fd->inode, xdata, this, is_append, write_append);
+    rsp_xdata = _fill_writev_xdata(fd->inode, xdata, this, is_append,
+                                   write_append);
     /* writev successful, we also need to get the stat of
      * the file we wrote to
      */
@@ -6032,10 +6033,7 @@ posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
         if (op_ret >= 0) {
             op_ret = 0;
 
-            list_for_each_entry(entry, &entries.list, list)
-            {
-                op_ret++;
-            }
+            list_for_each_entry(entry, &entries.list, list) { op_ret++; }
         }
 
         STACK_UNWIND_STRICT(readdirp, frame, op_ret, op_errno, &entries, NULL);

…e path

We fetch it once (in posix_writev() or posix_writev_fill_rsp_dict() in io_uring code)
and then again in _fill_writev_xdata().

Signed-off-by: Yaniv Kaul <[email protected]>
Updates: gluster#1000
@gluster-ant
Copy link
Collaborator

CLANG-FORMAT FAILURE:
Before merging the patch, this diff needs to be considered for passing clang-format

index cac41f05c..7d747266d 100644
--- a/xlators/storage/posix/src/posix-inode-fd-ops.c
+++ b/xlators/storage/posix/src/posix-inode-fd-ops.c
@@ -6033,10 +6033,7 @@ posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
         if (op_ret >= 0) {
             op_ret = 0;
 
-            list_for_each_entry(entry, &entries.list, list)
-            {
-                op_ret++;
-            }
+            list_for_each_entry(entry, &entries.list, list) { op_ret++; }
         }
 
         STACK_UNWIND_STRICT(readdirp, frame, op_ret, op_errno, &entries, NULL);

@mykaul
Copy link
Contributor Author

mykaul commented May 25, 2024

/run regression

@gluster-ant
Copy link
Collaborator

1 test(s) failed
./tests/bugs/distribute/bug-1286171.t

0 test(s) generated core

10 test(s) needed retry
./tests/000-flaky/basic_afr_split-brain-favorite-child-policy.t
./tests/000-flaky/basic_distribute_rebal-all-nodes-migrate.t
./tests/000-flaky/bugs_distribute_bug-1117851.t
./tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t
./tests/basic/afr/sparse-file-self-heal.t
./tests/basic/ec/ec-1468261.t
./tests/basic/quota.t
./tests/basic/shd-mux-ec.t
./tests/bugs/bitrot/bug-1245981.t
./tests/bugs/distribute/bug-1286171.t

1 flaky test(s) marked as success even though they failed
./tests/000-flaky/bugs_distribute_bug-1117851.t
https://build.gluster.org/job/gh_centos7-regression/3402/

@mykaul
Copy link
Contributor Author

mykaul commented May 30, 2024

/run regression

@mykaul
Copy link
Contributor Author

mykaul commented Jun 2, 2024

./tests/bugs/distribute/bug-1286171.t seems to be flaky - it passed now (it had nothing to do with this patch I believe). I'm not sure there's an open bug on this, but it looks like this is ready for review.

@amarts amarts merged commit 61d72e1 into gluster:devel Oct 18, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants