You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "GUIDINGLI (via GitHub)" <gi...@apache.org> on 2024/09/13 16:02:27 UTC

[PR] ramlog bug fix [nuttx]

GUIDINGLI opened a new pull request, #13438:
URL: https://github.com/apache/nuttx/pull/13438

   ## Summary
   
   ramlog: unify the lock to critical section
   ramlog: workaround the unsafe critical section
   
   ```
       thread1:                           thread2:
       ramlog_addbuf()
           enter_critical_section()
           ramlog_pollnotify()
              foreach rl_list
                    --> switch out
                                          ramlog_file_close
                                          enter_critical_section()
                                          list_delete()
                                          leave_critical_section()
                    <--- switch back
              rl_list error
           leave_critical_section()
   
   ```
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ramlog bug fix [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #13438:
URL: https://github.com/apache/nuttx/pull/13438#discussion_r1759627054


##########
drivers/syslog/ramlog.c:
##########
@@ -337,6 +337,13 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
 
   if (len > 0)
     {
+      /* Lock the scheduler do NOT switch out */
+
+      if (!up_interrupt_context())
+        {
+          sched_lock();
+        }

Review Comment:
   Merge these 2 commits. The other one will not work without the other. The CI will also break If submitted separately



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ramlog bug fix [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao merged PR #13438:
URL: https://github.com/apache/nuttx/pull/13438


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org