Skip to content

fix fadvise - issue 1227#496

Merged
arogge merged 2 commits intobareos:masterfrom
gjelu:issue-1227
May 11, 2020
Merged

fix fadvise - issue 1227#496
arogge merged 2 commits intobareos:masterfrom
gjelu:issue-1227

Conversation

@gjelu
Copy link
Contributor

@gjelu gjelu commented Apr 27, 2020

if (bfd->flags_ & O_RDONLY) {
/* If not RDWR or WRONLY must be Read Only */
if (!(bfd->m_flags & (O_RDWR|O_WRONLY))) {
fdatasync(bfd->fid); /* sync the file */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fdatasync(bfd->fid); /* sync the file */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this and we agree that calling fdatasync() is not a good idea in this case.

#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
if (bfd->flags_ & O_RDONLY) {
/* If not RDWR or WRONLY must be Read Only */
if (!(bfd->m_flags & (O_RDWR|O_WRONLY))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(bfd->m_flags & (O_RDWR|O_WRONLY))) {
if (!(bfd->flags_ & (O_RDWR|O_WRONLY))) {

@arogge
Copy link
Member

arogge commented Apr 30, 2020

Could you please update the commit message according to https://docs.bareos.org/DeveloperGuide/gitworkflow.html#commit-message-guideline so it at least contains #1227: Fix fadvise bug, so Mantis will pick up the change automatically?
Thank you!

@arogge arogge merged commit 8a1e696 into bareos:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants