glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

Fix the crash consistency bug discussed in #3983

Open lvtao-sec opened this issue 1 year ago • 6 comments

Hi @pranithk ,

We discussed one crash consistency bug a long time ago in #3983. You proposed one patch for fixing that bug. But it missed a few lines, leading to a compilation error. Now I have fixed it and tested it; it works correctly.

Can we merge this patch to the main branch?

Thanks!

lvtao-sec avatar Dec 18 '23 17:12 lvtao-sec

Can one of the admins verify this patch?

gluster-ant avatar Dec 18 '23 17:12 gluster-ant

Can one of the admins verify this patch?

gluster-ant avatar Dec 18 '23 17:12 gluster-ant

Can one of the admins verify this patch?

gluster-ant avatar Dec 18 '23 17:12 gluster-ant

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

index 911403ed3..c60cd4e6d 100644
--- a/xlators/storage/posix/src/posix-inode-fd-ops.c
+++ b/xlators/storage/posix/src/posix-inode-fd-ops.c
@@ -6036,10 +6036,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);

gluster-ant avatar Dec 18 '23 17:12 gluster-ant

Hi, Sorry to bother you again. Can anyone check this patch? @mohit84 @amarts Thanks!

lvtao-sec avatar Dec 20 '23 10:12 lvtao-sec

The patch looks good to me. It is matching the snippet proposed in the issue.

Please add Fixes: #3983 in the commit and resubmit.

@pranithk please review.

aravindavk avatar Feb 08 '24 10:02 aravindavk

Resubmitted here: https://github.com/gluster/glusterfs/pull/4311

lvtao-sec avatar Feb 20 '24 13:02 lvtao-sec