Bug 1499811

Summary: [storage/posix] - posix_do_futimes function not implemented
Product: [Community] GlusterFS Reporter: Karthik U S <ksubrahm>
Component: posixAssignee: Karthik U S <ksubrahm>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.12CC: bugs, ksubrahm, ndevos, rabhat, rjoseph, rtalur
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1350406 Environment:
Last Closed: 2017-11-13 05:46:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1350406    
Bug Blocks:    

Description Karthik U S 2017-10-09 12:48:08 UTC
+++ This bug was initially created as a clone of Bug #1350406 +++

Description of problem:

While I was trying to handle the utimes using the fd, it was giving the error "Function not implemented (ENOSYS)" for the posix_do_futimes function. I am not sure why this function is not complete and please correct me if this function has left incomplete, because of some reasons. Otherwise this function needs to be implemented to handle the utime changes with fds.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Niels de Vos on 2016-06-27 07:45:55 EDT ---

There is only one call to posix_do_futimes(), in posix_fsetattr(), the handler for the FSETATTR FOP:

        if (valid & (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME)) {
                op_ret = posix_do_futimes (this, pfd->fd, stbuf);

I'm surprised that posix_do_futimes() is not implemented.

Have you tested this with a small test program that uses futimes()?

--- Additional comment from Karthik U S on 2016-06-27 08:02:25 EDT ---

Yes I have tested it. I was trying to do the state transition of a file from normal state to WORM-Retained state with the WRITE fop. While doing this it was giving this error. The current implementation is as follows:

static int
posix_do_futimes (xlator_t *this,
                  int fd,
                  struct iatt *stbuf)
{
        gf_msg (this->name, GF_LOG_WARNING, ENOSYS, P_MSG_UNKNOWN_OP,
                "function not implemented fd(%d)", fd);

        errno = ENOSYS;
        return -1;
}

I have implemented the function by looking into the posix code. I will be pushing it for review in a while.

--- Additional comment from Vijay Bellur on 2016-06-27 08:29:40 EDT ---

REVIEW: http://review.gluster.org/14815 (storage/posix: Adding implementation for posix_do_futimes) posted (#1) for review on master by Karthik U S (ksubrahm)

--- Additional comment from Vijay Bellur on 2016-07-01 03:14:41 EDT ---

REVIEW: http://review.gluster.org/14815 (storage/posix: Adding implementation for posix_do_futimes) posted (#2) for review on master by Karthik U S (ksubrahm)

--- Additional comment from Worker Ant on 2017-06-20 03:08:24 EDT ---

REVIEW: https://review.gluster.org/14815 (storage/posix: Adding implementation for posix_do_futimes) posted (#3) for review on master by Karthik U S (ksubrahm)

--- Additional comment from Worker Ant on 2017-10-04 02:40:36 EDT ---

REVIEW: https://review.gluster.org/14815 (storage/posix: Adding implementation for posix_do_futimes) posted (#4) for review on master by Karthik U S (ksubrahm)

--- Additional comment from Worker Ant on 2017-10-05 08:57:39 EDT ---

COMMIT: https://review.gluster.org/14815 committed in master by Jeff Darcy (jeff.us) 
------
commit 601b6547f2c53651b88a0560a41d702db06c0d1c
Author: karthik-us <ksubrahm>
Date:   Mon Jun 27 17:17:56 2016 +0530

    storage/posix: Adding implementation for posix_do_futimes
    
    Adding the implementation for the posix_do_futimes function which is
    not complete in the current implementation and giving the ENOSYS error.
    
    Change-Id: I9cfc95a7ea293b0a2df8efd4ac80d0120b3120e4
    BUG: 1350406
    Signed-off-by: karthik-us <ksubrahm>

Comment 1 Worker Ant 2017-10-09 12:55:54 UTC
REVIEW: https://review.gluster.org/18453 (storage/posix: Adding implementation for posix_do_futimes) posted (#1) for review on release-3.12 by Karthik U S (ksubrahm)

Comment 2 Karthik U S 2017-11-13 05:46:18 UTC
Since this is kind of a new feature, we are not planning to take this in with the older releases. This is is fixed in master now.
Mainline patch: https://review.gluster.org/#/c/14815/