Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 951526 Details for
Bug 1158120
Data corruption due to lack of cache revalidation on open
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to check cache validity when opening or locking a file (corrected)
glusterfs-3.6-cache_openlock.patch (text/plain), 3.48 KB, created by
Philip Spencer
on 2014-10-28 20:36:24 UTC
(
hide
)
Description:
Patch to check cache validity when opening or locking a file (corrected)
Filename:
MIME Type:
Creator:
Philip Spencer
Created:
2014-10-28 20:36:24 UTC
Size:
3.48 KB
patch
obsolete
>diff -ur glusterfs-3.6.0beta3.orig/xlators/performance/md-cache/src/md-cache.c glusterfs-3.6.0beta3/xlators/performance/md-cache/src/md-cache.c >--- glusterfs-3.6.0beta3.orig/xlators/performance/md-cache/src/md-cache.c 2014-09-30 14:17:59.000000000 -0400 >+++ glusterfs-3.6.0beta3/xlators/performance/md-cache/src/md-cache.c 2014-10-28 10:29:11.774144586 -0400 >@@ -136,6 +136,7 @@ > char *linkname; > char *key; > dict_t *xattr; >+ struct gf_flock lock; > }; > > >@@ -2039,6 +2040,104 @@ > return 0; > } > >+int mdc_open_check_cache_cbk(call_frame_t *frame, void *cookie, >+ xlator_t *this, int op_ret, int op_errno, >+ struct iatt *stbuf, dict_t *xdata) >+{ >+ mdc_local_t *local = NULL; >+ local = frame->local; >+ >+ if (! local) { >+ gf_log(this->name, GF_LOG_CRITICAL, >+ "local undefined"); >+ MDC_STACK_UNWIND(open, frame, -1, EINVAL, NULL, NULL); >+ } >+ >+ if (! op_ret) mdc_inode_iatt_set(this, local->fd->inode, stbuf); >+ MDC_STACK_UNWIND(open, frame, 0, 0, local->fd, local->xattr); >+ return 0; >+} >+ >+ >+int mdc_open_check_cache(call_frame_t *frame, void *cookie, xlator_t *this, >+ int op_ret, int op_errno, fd_t *fd, dict_t *xdata) >+{ >+ mdc_local_t *local = NULL; >+ >+ if (op_ret != 0) goto nocheck; >+ local = mdc_local_get(frame); >+ if (!local) goto nocheck; >+ local->fd = fd_ref(fd); >+ if (xdata) local->xattr = dict_ref (xdata); >+ STACK_WIND(frame, mdc_open_check_cache_cbk, >+ FIRST_CHILD (this), FIRST_CHILD(this)->fops->fstat, fd, NULL); >+ return 0; >+nocheck: >+ MDC_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata); >+ return 0; >+} >+ >+int >+mdc_open (call_frame_t *frame, xlator_t *this, >+ loc_t *loc, int flags, fd_t *fd, dict_t *xdata) >+{ >+ >+ STACK_WIND (frame, mdc_open_check_cache, >+ FIRST_CHILD (this), FIRST_CHILD (this)->fops->open, >+ loc, flags, fd, xdata); >+ return 0; >+} >+ >+int mdc_lk_check_cache_cbk(call_frame_t *frame, void *cookie, >+ xlator_t *this, int op_ret, int op_errno, >+ struct iatt *stbuf, dict_t *xdata) >+{ >+ mdc_local_t *local = NULL; >+ local = frame->local; >+ >+ if (! local) { >+ gf_log(this->name, GF_LOG_CRITICAL, >+ "local undefined"); >+ MDC_STACK_UNWIND(lk, frame, -1, EINVAL, NULL, NULL); >+ } >+ >+ if (! op_ret) mdc_inode_iatt_set(this, local->fd->inode, stbuf); >+ MDC_STACK_UNWIND(lk, frame, 0, 0, &local->lock, local->xattr); >+ return 0; >+} >+ >+int mdc_lk_check_cache(call_frame_t *frame, void *cookie, xlator_t *this, >+ int op_ret, int op_errno, struct gf_flock *flock, dict_t *xdata) >+{ >+ mdc_local_t *local = NULL; >+ local = frame->local; >+ if (op_ret != 0 || !local) { >+ MDC_STACK_UNWIND(lk, frame, op_ret, op_errno, flock, xdata); >+ return 0; >+ } >+ local->xattr = dict_ref(xdata); >+ local->lock = *flock; >+ STACK_WIND(frame, mdc_lk_check_cache_cbk, >+ FIRST_CHILD (this), FIRST_CHILD(this)->fops->fstat, >+ local->fd, NULL); >+ return 0; >+} >+ >+ >+int >+mdc_lk (call_frame_t *frame, xlator_t *this, >+ fd_t *fd, int32_t cmd, struct gf_flock *flock, dict_t *xdata) >+{ >+ mdc_local_t *local = NULL; >+ local = mdc_local_get(frame); >+ if (local) local->fd = fd_ref(fd); >+ >+ STACK_WIND (frame, mdc_lk_check_cache, >+ FIRST_CHILD (this), FIRST_CHILD(this)->fops->lk, >+ fd, cmd, flock, xdata); >+ return 0; >+} >+ > int > mdc_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, > int32_t op_ret, int32_t op_errno, >@@ -2290,6 +2389,8 @@ > .fallocate = mdc_fallocate, > .discard = mdc_discard, > .zerofill = mdc_zerofill, >+ .open = mdc_open, >+ .lk = mdc_lk, > }; > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1158120
:
951437
| 951526